Page 1 of 1

Hostname changes

Posted: Thu May 02, 2013 3:58 pm
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?

Re: Hostname changes

Posted: Thu May 02, 2013 4:13 pm
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.

Re: Hostname changes

Posted: Fri May 03, 2013 9:21 am
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.

Re: Hostname changes

Posted: Fri May 03, 2013 3:29 pm
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.