Hey Everyone
Thought i would post this question to see if anyone has any ideas. We need to monitor a port on 2 servers, but we only want an alert if port is ACTIVE on BOTH servers. If its active on only one, then that is fine as that is how it should be, but we cannot have both ports active
Anyone have any suggestions best way to monitor/alert with this?
Thanks in advance
Cheers!
Alert if port is active on 2 hosts
Re: Alert if port is active on 2 hosts
Hi Spcmidrange,
The easiest solution might be to write your own plugin in bash ( or perl or python if you prefer). Writing your own plugin isn't all that difficult and would give you some flexibility in terms of logic and behavior (e.g. - introduce vary a delay between the two ports). One of the advantages of nagios is you can use the existing plugins in your script. For example give this a try on the command line:
/usr/local/nagios/libexec/check_tcp -H 127.0.0.1 -p 22
Here are a couple of resources to help you get started:
https://exchange.nagios.org/directory/T ... pt/details
https://nagios-plugins.org/doc/guidelines.html
https://assets.nagios.com/downloads/nag ... ugins.html
Please let us know if that's helpful.
The easiest solution might be to write your own plugin in bash ( or perl or python if you prefer). Writing your own plugin isn't all that difficult and would give you some flexibility in terms of logic and behavior (e.g. - introduce vary a delay between the two ports). One of the advantages of nagios is you can use the existing plugins in your script. For example give this a try on the command line:
/usr/local/nagios/libexec/check_tcp -H 127.0.0.1 -p 22
Here are a couple of resources to help you get started:
https://exchange.nagios.org/directory/T ... pt/details
https://nagios-plugins.org/doc/guidelines.html
https://assets.nagios.com/downloads/nag ... ugins.html
Please let us know if that's helpful.
-
- Posts: 47
- Joined: Fri Jun 15, 2012 12:54 pm
Re: Alert if port is active on 2 hosts
Thank you for your reply kfanselow.
We were already thinking that route, but thought we would put it out here to the forum to see if anyone else had other suggestions.
Cheers!
We were already thinking that route, but thought we would put it out here to the forum to see if anyone else had other suggestions.
Cheers!
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Alert if port is active on 2 hosts
Hi,
Thanks for posting this. Yeah, a wrapper script to handle the logic would be the recommended approach.
Let us know if you need anything else or if it's okay to close this out.
--Benjamin
Thanks for posting this. Yeah, a wrapper script to handle the logic would be the recommended approach.
Let us know if you need anything else or if it's okay to close this out.
--Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 47
- Joined: Fri Jun 15, 2012 12:54 pm
Re: Alert if port is active on 2 hosts
Sorry for the late reply
Thank you for your suggestions. You can close this request
Cheers!
Thank you for your suggestions. You can close this request
Cheers!