Creating hosting for my 2 client that using windows

Im First time using icinga2. And this project is for my final year project. Can anyone help me with my topic. Im trying to adding host to my icinga2. I using icinga2 to create delay detection for my 2 hosting client. these client are using windows as their OS. So im just want to know how to use icinga director to add host because until now im adding host it only can use ping command and not any http or any SNMP.

Icinga2 Version

icinga2 - The Icinga 2 network monitoring daemon (version: r2.14.2-1)

Copyright (c) 2012-2024 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later https://gnu.org/licenses/gpl2.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
Platform: Ubuntu
Platform version: 22.04.4 LTS (Jammy Jellyfish)
Kernel: Linux
Kernel version: 6.5.0-14-generic
Architecture: x86_64

Build information:
Compiler: GNU 11.4.0
Build host: runner-hh8q3bz2-project-575-concurrent-0
OpenSSL version: OpenSSL 3.0.2 15 Mar 2022

Application information:

General paths:
Config directory: /etc/icinga2
Data directory: /var/lib/icinga2
Log directory: /var/log/icinga2
Cache directory: /var/cache/icinga2
Spool directory: /var/spool/icinga2
Run directory: /run/icinga2

Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /var

Internal paths:
Package data directory: /usr/share/icinga2
State path: /var/lib/icinga2/icinga2.state
Modified attributes path: /var/lib/icinga2/modified-attributes.conf
Objects path: /var/cache/icinga2/icinga2.debug
Vars path: /var/cache/icinga2/icinga2.vars
PID path: /run/icinga2/icinga2.pid

icinga2 daemon -C

[2024-04-10 00:14:37 +0800] information/cli: Icinga application loader (version: r2.14.2-1)
[2024-04-10 00:14:37 +0800] information/cli: Loading configuration file(s).
[2024-04-10 00:14:37 +0800] information/ConfigItem: Committing config item(s).
[2024-04-10 00:14:37 +0800] information/ApiListener: My API identity: panli-VirtualBox
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 2 NotificationCommands.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 13 Notifications.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 1 IcingaApplication.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 2 HostGroups.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 1 Host.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 1 Downtime.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 1 IcingaDB.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 1 FileLogger.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 3 Zones.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 1 CheckerComponent.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 1 User.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 1 Endpoint.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 1 ApiUser.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 1 ApiListener.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 1 NotificationComponent.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 246 CheckCommands.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 1 UserGroup.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 3 ServiceGroups.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 3 TimePeriods.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 1 ScheduledDowntime.
[2024-04-10 00:14:37 +0800] information/ConfigItem: Instantiated 12 Services.
[2024-04-10 00:14:37 +0800] information/ScriptGlobal: Dumping variables to file ‘/var/cache/icinga2/icinga2.vars’
[2024-04-10 00:14:37 +0800] information/cli: Finished validating the configuration file(s).

Enabled Features

Disabled features: command compatlog debuglog elasticsearch gelf graphite influxdb influxdb2 journald livestatus opentsdb perfdata syslog
Enabled features: api checker icingadb mainlog notification.

I hope all this detail can help me with the problem.
Thank you very much in advance.

Hi Panli,

Welcome to Icinga and thanks for trying it out!

If I understood you correctly, you have already configured your two hosts through the Icinga Director and now want to create services on those hosts to be monitored?

For starters, I would recommend you the following documentation pages:

The first link should give you an idea how to create and apply services to your hosts, e.g., for HTTP monitoring. The second one refers SNMP, as you mentioned it, and the last one comments on an installed Icinga Agent on the hosts.

Please take your time reading those pages and follow the links there. If you are having further questions later on, please feel free to post them here.

1 Like

So far im not done with my hosting this two host. Because the firewall from windows still blocking the connection to my icinga2. By the way, Im using VirtualBox as my medium to use this two OS at the same time.

This is after im apply my service set to the my Windows host. I can connect with Ping4 but not with any other services

And after the output unavailable it show this problem. And i dont know what is the wrong in this configuration

Can you provide the zones.conf of both the Icinga and the Windows host?

Icinga2 zones.conf

/*

  • Endpoint and Zone configuration for a cluster setup
  • This local example requires NodeName defined in
  • constants.conf.
    */

object Endpoint NodeName {
host = NodeName
}

object Zone ZoneName {
endpoints = [ NodeName ]
}

/*

  • Defines a global zone for distributed setups with masters,
  • satellites and clients.
  • This is required to sync configuration commands,
  • templates, apply rules, etc. to satellite and clients.
  • All nodes require the same configuration and must
  • have accept_config enabled in the api feature.
    */

object Zone “global-templates” {
global = true
}
/*

  • Defines a global zone for the Icinga Director.
  • This is required to sync configuration commands,
  • templates, apply rules, etc. to satellite and clients.
  • All nodes require the same configuration and must
  • have accept_config enabled in the api feature.
    */

object Zone “director-global” {
global = true
}

/*

  • Read the documentation on how to configure
  • a cluster setup with multiple zones.
    */

/*
object Endpoint “master.example.org” {
host = “master.example.org”
}

object Endpoint “satellite.example.org” {
host = “satellite.example.org”
}

object Zone “master” {
endpoints = [ “master.example.org” ]
}

object Zone “satellite” {
parent = “master”
endpoints = [ “satellite.example.org” ]
}
*/
object Zone “master” {
endpoints = [ “master.example.org” ]
}

object Zone “satellite” {
parent = “master”
endpoints = [ “satellite.example.org” ]
}
*/

Windows zones.Cond.f
/*

  • Generated by Icinga 2 node setup commands
  • on 2024-04-17 02:54:04 -0700
    */

object Endpoint “panli-VirtualBox” {
host = “192.168.10.5”
port = “5665”
}

object Zone “master” {
endpoints = [ “panli-VirtualBox” ]
}

object Endpoint “Windows-Local” {
}

object Zone “Windows-Local” {
endpoints = [ “Windows-Local” ]
parent = “master”
}

object Zone “global-templates” {
global = true
}

object Zone “director-global” {
global = true
}

If you have a Satellite, shouldn’t the panil-VirtualBox connect to the Satellite?

It looks like a mess to me, formating it as code would help.
Also which enpoints belong to which zones isn’t clear to me - maybe drawing a diagram would help?

I dont have any satelite. Im just copying the default code from zones.conf to you and not do any editing in this zones.conf. And the zones.conf from windows is it right im just download the icinga2 agent from the package.icinga2.com

So Right now what im going to do to connect this problem??

Im getting the ping from windows to my Icinga2 but cant connect to any port of http even im using port 80 or 443

image

object Endpoint “panli-VirtualBox” {
host = “192.168.10.5”
port = “5665”
}

object Zone “master” {
endpoints = [ “panli-VirtualBox” ]
}

To me, this looks like in the node setup, you told it, that the client is also the master or I miss understand your setup - why I asked about the diagram.

Have a look at the example from Distributed Monitoring - Icinga 2 :

object Endpoint "icinga2-master1.localdomain" {
  host = "192.168.56.101"
}

object Endpoint "icinga2-satellite1.localdomain" {
  host = "192.168.56.105"
}

object Zone "master" {
  endpoints = [ "icinga2-master1.localdomain" ]
}

object Zone "satellite" {
  endpoints = [ "icinga2-satellite1.localdomain" ]
  parent = "master"
}

The master only for the panli-VirtualBox.

Do i need to create this code into the zones.conf on my server and client??

object Endpoint “icinga2-master1.localdomain” {
host = “192.168.56.101”
}

object Endpoint “icinga2-satellite1.localdomain” {
host = “192.168.56.105”
}

object Zone “master” {
endpoints = [ “icinga2-master1.localdomain” ]
}

object Zone “satellite” {
endpoints = [ “icinga2-satellite1.localdomain” ]
parent = “master”
}

Normally this code, especially without satellites, is created by the director on the master and by the node setup on the agent.

Can you please list the Names and IPs of your master and agent?

master - panli-VirtualBox -192.168.10.5

Agent - Windows-Local - 192.168.10.6
Agent - Ubuntu - Local - 192.168.10.7 (Additional)

This is my Master and agent name and ip for my network infrastucture

As you use the director, you should see the agents in zones.d/master/agent_endpoints.conf and zones.d/master/agent_zones.conf and in zones.conf on the agent you should have something like:

object Endpoint "panli-VirtualBox" {
  host = "192.168.10.5"
  port = "5665"
}

object Endpoint "Windows-Local" {
}

object Zone "master" {
  endpoints = [ "panli-VirtualBox" ]
}

object Zone "Windows-Local" {
  endpoints = [ "Windows-Local" ]
  parent = "master"
}

object Zone "global-templates" {
        global = true
}

object Zone "director-global" {
        global = true
}

on the agent you can experiment by changing the zones.conf on the master I would trust the config build by the director.

Thanks Dominik!!.. I already done all the checkers because of this code
Hopefully this will help others as well.