Adding new host for monitoring

Hi

Could you please help me with how to add new host for monitoring?

I tried adding object in hosts.conf. But did not work.

object Host “icingaw” {
address = “hostaddres” --here I have given the host address
check_command = “hostalive”
}

Thanks&Regards
srinivas

  1. Which operating system and version are you running Icinga on?

  2. How did you install it?

  3. How much of the documentation for getting things set up have you followed?

https://icinga.com/docs/icinga2/latest/doc/02-installation/
https://icinga.com/docs/icinga2/latest/doc/03-monitoring-basics/
https://icinga.com/docs/icinga2/latest/doc/04-configuration/

  1. When you say it “did not work”, give us more details:

Tell us enough to understand what you’ve done, what you’ve tested, and what
happened as a result, and we might have enough information to be able to help.

Regards,

Antony.

1 Like

Hi

Thank you for the reply
Sorry for the confusion

OS : Linux Rehat 7.3

Actaully, I set up icinga2 and icinga web as per the documentation in test VM with Linux operating system. Everything worked fine and I could see the localhost being monitored.

Later, we made the package of the set up (icinga2, icingaweb-tar.gz) file and deployed the same on the new VM (UAT). Everthing is working fine. But issue is local host is being taken as the previous test machine. I wanted to change the locahlost value to the current UAT VM.

I changed the localhost value in constants.conf and restart the icinga services. An error message thrown as “could not find the certificate”. When I verified the certificate under the path /var/lib/icinga2/certs, I could see these certificates belonged to previous VM(test).

Then I tried with below (previously i did not add “import generic-hot” so it did not work) I jsut tried adding import. Now it is working

object Host “HOSTNAME” {
import “generic-host”
address = “SERVER_IP”
check_command = “hostalive”
}
Now, it is showing the UAT VM host being monitored but not as localhost…

So please suggest me how to change the localhost value to my current machine (on which I deployed the package).

If I have to generate certificate please guide me how to generate

Thanks&Regards
Srinivas

Hi,

changing the NodeName constant is not a good idea since the certificates are bound to that. Since you are having problems with the Host object being monitored, start your investigation there.

Where exactly did you put the host object definition, what’s the output from the config validation?

Cheers,
Michael