Hostname changes

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Hostname changes

Post by BanditBBS »

I can't believe I'm asking this :evil: My windows admins are just a pain!

is there any method to have Nagios notice a machine name change and either at least alert that it doesn't match the designated hostname or actually have it change the hostname?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Hostname changes

Post by slansing »

Interesting query, have you looked into making this a separate service check against..say, WMI? If the query is expecting to find a certain string, say... "machine name =" Then the WMI check should theoretically bail out with a critical, warning, whatever it may be and let you know via Nagios XI. As far as appending a entire host name for a configuration, now that does take some thinking.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Hostname changes

Post by BanditBBS »

I guess I could use check_dns. That will at least tell me if the dns resolution changes. If that happens, I suppose I might be able to write a script, for an event_handler, that could change the hostname configuration and restart Nagios. Only problem there, I would have to figure out where all it has to be changed in XI database.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Hostname changes

Post by sreinhardt »

As far as we know, after asking some bigger brains than mine, there is no great way to presently do this. If they are keeping the same IP you could do a wmi or nsclient check against the hostname to see when a change happens. From there you could look into using the rename tool via ccm, this would rename all of your rrd files and such as well. However this is just begging to cause issues.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked