how to monitor STARTING state?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
gornm565
Posts: 72
Joined: Tue Nov 15, 2016 6:11 pm

how to monitor STARTING state?

Post by gornm565 »

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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: how to monitor STARTING state?

Post by rkennedy »

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 -

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
echo $? is going to tell us the exit code, 0 is ok, 1 is warning, and 2 is critical.

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
This tells us that it says 'OK', but really it's exiting with a 2 which is critical.
Former Nagios Employee
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: how to monitor STARTING state?

Post by avandemore »

gornm565 wrote:Currently, I am only able to monitor services that are in a STOPPED 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.
Previous Nagios employee
gornm565
Posts: 72
Joined: Tue Nov 15, 2016 6:11 pm

Re: how to monitor STARTING state?

Post by gornm565 »

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

Re: how to monitor STARTING state?

Post by eloyd »

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.
Image
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?

Post by avandemore »

Does that answer your question @gornm565?
Previous Nagios employee
gornm565
Posts: 72
Joined: Tue Nov 15, 2016 6:11 pm

Re: how to monitor STARTING state?

Post by gornm565 »

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.
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?

Post by avandemore »

Can you use the Test Check Commandfrom the second screenshot and post the entirety of the command and output?
Previous Nagios employee
gornm565
Posts: 72
Joined: Tue Nov 15, 2016 6:11 pm

Re: how to monitor STARTING state?

Post by gornm565 »

COMMAND: /usr/local/nagios/libexec/check_nt -H SERVERP01 -s "check123" -p 12489 -v SERVICESTATE -l MarketDataService.1 -d SHOWALL
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?

Post by avandemore »

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
Locked