Add duplicate IP Address test to preflight checks

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guyver1
Posts: 27
Joined: Tue Apr 16, 2019 4:43 am

Add duplicate IP Address test to preflight checks

Post 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.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Add duplicate IP Address test to preflight checks

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
Guyver1
Posts: 27
Joined: Tue Apr 16, 2019 4:43 am

Re: Add duplicate IP Address test to preflight checks

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Add duplicate IP Address test to preflight checks

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Add duplicate IP Address test to preflight checks

Post by eloyd »

Or search /usr/local/nagios/rw/objects.cache for dupes.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Add duplicate IP Address test to preflight checks

Post by scottwilkerson »

eloyd wrote:Or search /usr/local/nagios/rw/objects.cache for dupes.
Another option
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked