Hello everybody!
I just installed EyesOfNetwork and configured Nagios with my WorkStations, Servers, and added them in some Host Groups.
My intention is to define the ping check severity to OK => "UP" and TIMEOUT => "WARN" for the users computers, but keep the default severity (OK => "UP" and TIMEOUT => "DOWN") for all other Host Groups, including servers.
Is there a way to do so ?
Thank you in advance and have a great day!
Define ping severity for a Host Group
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Define ping severity for a Host Group
Hi,
Welcome to the Nagios Community Forum!
You would have to change the exit codes in the plugin ( make your own custom version).
Nagios Plugins Development Guidelines
Nagios State Types
Hope that helps get you started.
Benjamin
Nagios Support Team
Welcome to the Nagios Community Forum!
You would have to change the exit codes in the plugin ( make your own custom version).
Nagios Plugins Development Guidelines
Nagios State Types
Hope that helps get you started.
Benjamin
Nagios Support Team
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!
Re: Define ping severity for a Host Group
Hello!
Thanks for your answer. I located a plugin directory but I was not able to edit exit codes because "check_ping" is not a regular sh script but some compilated language, and in dev guidelines I didn't found infos about plugins directory so I'm quite stuck here..
Thanks for your answer. I located a plugin directory but I was not able to edit exit codes because "check_ping" is not a regular sh script but some compilated language, and in dev guidelines I didn't found infos about plugins directory so I'm quite stuck here..
Re: Define ping severity for a Host Group
I don't know much about EyesOfNetwork, and how it handles Nagios Plugin outputs. A lot of what is below assumes you're configuring checks in Nagios Core.
The first thing to understand is the difference between service checks and host checks:
https://assets.nagios.com/downloads/nag ... hecks.html
https://assets.nagios.com/downloads/nag ... hecks.html
Per the specification, Nagios plugins must output 1 of 4 possible numeric statuses (as a POSIX exit code):
https://assets.nagios.com/downloads/nag ... ility.html
One thing that is for certain is a host check can never be in a "WARNING" state -- per the spec, this numeric code of 1 is either interpreted by Nagios Core as either UP, DOWN, or UNREACHABLE depending on some top-level Nagios Core configurations that cannot be overwritten at the hostgroup level (to my knowledge). If you want to leverage a WARNING state for use in alerting logic, you would need to configure this check as a service check. This service check could be applied to an entire hostgroup if you wanted -- see more in this post:
https://support.nagios.com/forum/viewto ... 83#p327983
If you were to configure these checks as service checks, using those standard 0/1/2/3 exit codes, the check_ping plugin does allow you to specify what exit code you want when a timeout is reached:
http://nagios-plugins.org/doc/man/check_ping.html
In your case, if you wanted to "warn" after a 15 second timeout, the argument passed to the check_ping plugin might look something like this:
If you want check_ping to behave in some way not supported by its accepted arguments, you'd have to fiddle around with the C and recompile it:
https://github.com/nagios-plugins/nagio ... eck_ping.c
The first thing to understand is the difference between service checks and host checks:
https://assets.nagios.com/downloads/nag ... hecks.html
https://assets.nagios.com/downloads/nag ... hecks.html
Per the specification, Nagios plugins must output 1 of 4 possible numeric statuses (as a POSIX exit code):
- 0 (OK)
- 1 (WARNING)
- 2 (CRITICAL)
- 3 (UNKNOWN)
https://assets.nagios.com/downloads/nag ... ility.html
One thing that is for certain is a host check can never be in a "WARNING" state -- per the spec, this numeric code of 1 is either interpreted by Nagios Core as either UP, DOWN, or UNREACHABLE depending on some top-level Nagios Core configurations that cannot be overwritten at the hostgroup level (to my knowledge). If you want to leverage a WARNING state for use in alerting logic, you would need to configure this check as a service check. This service check could be applied to an entire hostgroup if you wanted -- see more in this post:
https://support.nagios.com/forum/viewto ... 83#p327983
If you were to configure these checks as service checks, using those standard 0/1/2/3 exit codes, the check_ping plugin does allow you to specify what exit code you want when a timeout is reached:
http://nagios-plugins.org/doc/man/check_ping.html
Code: Select all
-t, --timeout=INTEGER:<timeout state>
Seconds before connection times out (default: 10)
Optional ":<timeout state>" can be a state integer (0,1,2,3) or a state STRING
Code: Select all
--timeout=15:1
https://github.com/nagios-plugins/nagio ... eck_ping.c
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Define ping severity for a Host Group
Hello,
Thanks for your detailed answer and precisions. I created a new command named check_ping_warn and a new Template only for workstations. It works, as the new command is applied only for workstations, but it still displays "DOWN" for hosts unreachable and hosts timed out after 11 seconds, even with the parameter "--timeout=5:1". But it's already a good beginning!
The complete command :
Thanks for your detailed answer and precisions. I created a new command named check_ping_warn and a new Template only for workstations. It works, as the new command is applied only for workstations, but it still displays "DOWN" for hosts unreachable and hosts timed out after 11 seconds, even with the parameter "--timeout=5:1". But it's already a good beginning!
The complete command :
Code: Select all
$USER1$/check_ping -H $HOSTADDRESS$ -w 500.0,150% -c 100000.0,150% -p 1 --timeout=5:1