how to monitor STARTING state?
how to monitor STARTING state?
Currently, I am only able to monitor services that are in a STOPPED state. How do I monitor services that are in the STARTING state? I need to be getting critical alerts for those.
Thanks a lot.
Thanks a lot.
Re: how to monitor STARTING state?
You can use the negate plugin (which will flip statuses from OK -> CRITICAL) to accomplish this. See this link - https://assets.nagios.com/downloads/nag ... ios-XI.pdf
For example, this is an OK state -
echo $? is going to tell us the exit code, 0 is ok, 1 is warning, and 2 is critical.
This tells us that it says 'OK', but really it's exiting with a 2 which is critical.
For example, this is an OK state -
Code: Select all
[root@bob libexec]# ./check_http -H google.com
HTTP OK: HTTP/1.1 301 Moved Permanently - 559 bytes in 0.097 second response time |time=0.096733s;;;0.000000 size=559B;;;0
[root@bob libexec]# echo $?
0
Code: Select all
[root@bob libexec]# ./negate -o CRITICAL ./check_http -H google.com
HTTP OK: HTTP/1.1 301 Moved Permanently - 559 bytes in 0.093 second response time |time=0.093093s;;;0.000000 size=559B;;;0
[root@bob libexec]# echo $?
2
Former Nagios Employee
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: how to monitor STARTING state?
Can you describe what you mean by this? In the Nagios "world" these states exist: OK, WARNING, CRITICAL, UNKNOWN. A service is monitored by its definition and associations not its state, at least not without drastic alterations.gornm565 wrote:Currently, I am only able to monitor services that are in a STOPPED state.
Previous Nagios employee
Re: how to monitor STARTING state?
I meant a Windows service. You can setup an alert to notify you when a Windows Service crashes and enters a STOPPED state. Sometimes a service hangs in the STARTING state and nagios doesn't let us know.
Re: how to monitor STARTING state?
If it's not Started, and it's not Stopped, it must be Starting. So negate your Stopped and Started and you'll have Starting.
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: how to monitor STARTING state?
Does that answer your question @gornm565?
Previous Nagios employee
Re: how to monitor STARTING state?
Sorry, need a little bit more detailed help on this.
Is there a way to do this in the GUI and if yes, where would I make these changes? I attached 3 screenshot of a Windows service "MarketDataService.1". It's "STARTED", so it shows a green OK. Where do I make the config changes that would also send me an alert if the service gets stuck in the STARTING state?
Thanks.
Is there a way to do this in the GUI and if yes, where would I make these changes? I attached 3 screenshot of a Windows service "MarketDataService.1". It's "STARTED", so it shows a green OK. Where do I make the config changes that would also send me an alert if the service gets stuck in the STARTING state?
Thanks.
You do not have the required permissions to view the files attached to this post.
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: how to monitor STARTING state?
Can you use the Test Check Commandfrom the second screenshot and post the entirety of the command and output?
Previous Nagios employee
Re: how to monitor STARTING state?
COMMAND: /usr/local/nagios/libexec/check_nt -H SERVERP01 -s "check123" -p 12489 -v SERVICESTATE -l MarketDataService.1 -d SHOWALL
OUTPUT: MarketDataService.1: Started
OUTPUT: MarketDataService.1: Started
avandemore wrote:Can you use the Test Check Commandfrom the second screenshot and post the entirety of the command and output?
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: how to monitor STARTING state?
After digging into this, I do not believe check_nt is usable for your situation. It's a wrapper for NSClient which actually does have the functionality. So the summary is your best bet is to setup NRPE and use that to run the check via NSCLient and alert accordingly.
Previous Nagios employee