Page 1 of 1

Add duplicate IP Address test to preflight checks

Posted: Tue Aug 06, 2019 4:24 am
by Guyver1
Can you please add a duplicate IP address test for different hosts when running preflight checks please?

I'm currently updating an existing environment and doing a lot of copy and pasting when creating new hosts.

Very rarely, I forget to update the IP address on the new entry and it retains the previous hosts ip address.

This does not show itself as a problem when viewing the nagios charts on the website as the host is technically up (I get around this by adding in the system/node check in NCPA so I have a visual sanity check when viewing the web console).

It would be great if nagios could pick this up before I restart the nagios service after adding in new hosts.

Re: Add duplicate IP Address test to preflight checks

Posted: Tue Aug 06, 2019 7:40 am
by eloyd
If this gets added, it must be a warning, not a failure. We often use the same IP address on different machine names specifically for testing and/or doing complicated service dependencies.

Re: Add duplicate IP Address test to preflight checks

Posted: Tue Aug 06, 2019 12:44 pm
by Guyver1
Yeah a Warning is fine with me :mrgreen:
eloyd wrote:If this gets added, it must be a warning, not a failure. We often use the same IP address on different machine names specifically for testing and/or doing complicated service dependencies.

Re: Add duplicate IP Address test to preflight checks

Posted: Tue Aug 06, 2019 3:55 pm
by scottwilkerson
Because so many people use the same $HOSTADDRESS$ for multiple hosts, I really don't think this is going to get in there.

I alternatively would recommend writing a script that parses the json delivered with the JSON API for the address field to find/display duplicates

Code: Select all

/nagios/cgi-bin/objectjson.cgi?query=hostlist&details=true

Re: Add duplicate IP Address test to preflight checks

Posted: Tue Aug 06, 2019 5:21 pm
by eloyd
Or search /usr/local/nagios/rw/objects.cache for dupes.

Re: Add duplicate IP Address test to preflight checks

Posted: Wed Aug 07, 2019 6:52 am
by scottwilkerson
eloyd wrote:Or search /usr/local/nagios/rw/objects.cache for dupes.
Another option