«Status Information» doesn’t show drive status when it is OK

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
ssm_mon
Posts: 19
Joined: Tue Feb 24, 2015 11:37 am

«Status Information» doesn’t show drive status when it is OK

Post by ssm_mon »

Hello,
We use «Nagios Core 4.2.4» and plugin «check_npre 3.0.1», with «NSClient++ 0.5.0.62» on Windows servers.

When we check space on a single drive or volume, we want to obtain the following data in Status Information: drive status (OK, Warning or Critical) - according to thresholds set with «warn» and «crit» options - and drive total, free (GB and %) and used (GB and %) space.

We are using the following syntax:
./check_nrpe -H host address -c check_drivesize -a "warn=used gt 90%" "crit=used gt 95%" show-all "detail-syntax=%(drive): Total: %(size) - Used: %(total_used (%(total_used_pct)%) - Free: %(total_free) (%(total_free_pct)%)" drive=C

Unfortunately, with this syntax, «Status Information» doesn’t show the drive status when it’s OK, although it shows the drive status when it’s «Warning» or «Critical». Here are Status Information examples in these 3 different situations:
  • C:: Total: 79.656GB - Used: 61.292GB (77%) - Free: 18.364GB (23%) [result for "warn=used gt 90%" "crit=used gt 95%"]
    warning(C:: Total: 79.656GB - Used: 61.292GB (77%) - Free: 18.364GB (23%)) [result for "warn=used gt 75%" "crit=used gt 95%"]
    critical(C:: Total: 79.656GB - Used: 61.292GB (77%) - Free: 18.364GB (23%)) [result for "warn=used gt 75%" "crit=used gt 75%"]
We use:
1. «show-all» option, to obtain drive total, free and used space when status is OK. If this option is not used and status is OK, «Status Information» is «OK All 1 drive(s) are ok»;
2. «top-syntax» option, not to obtain a duplicated drive status when it’s «warning» or «critical». In fact, without this option, «Status Information» is like this:
  • OK C:: Total: 79.656GB - Used: 61.298GB (77%) - Free: 18.358GB (23%)
    WARNING warning(C:: Total: 79.656GB - Used: 61.297GB (77%) - Free: 18.36GB (23%))
    CRITICAL critical(C:: Total: 79.656GB - Used: 61.297GB (77%) - Free: 18.36GB (23%))
We have already created a topic about this issue in NSClient Forum (http://forums.nsclient.org) but we received no replies.
Can someone help us please?
Thanks in advance!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: «Status Information» doesn’t show drive status when it i

Post by ssax »

The NSClient++ developers will need to look at this as it's a problem in their code, it doesn't output the ok(data) like the others because it wasn't implemented the same way.
ssm_mon
Posts: 19
Joined: Tue Feb 24, 2015 11:37 am

Re: «Status Information» doesn’t show drive status when it i

Post by ssm_mon »

ssax: thanks for your reply.
As you can see in the attachment to this reply (the line above the last), we have already created a topic about this issue in NSClient Forum (http://forums.nsclient.org) 7 days ago, but we received no replies.
What should we do now? Is there another forum where we might create a topic about this problem?
Attachments
NSClient_topic.png
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: «Status Information» doesn’t show drive status when it i

Post by tgriep »

If you don't want to wait for the developer at nsclient.org, you can install the SNMP daemon on your windows system and monitor it using SNMP.
The output of the SNMP check, does show Drive size when it is OK.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: «Status Information» doesn’t show drive status when it i

Post by ssax »

The NSClient++ developers will need to fix it, here is as close as I can get you:
check_drivesize_wrapper.zip
(500 Bytes) Downloaded 190 times
1. Download the attached file, unzip it, and put it in:

Code: Select all

/usr/local/nagios/libexec
2. Then run these commands:

Code: Select all

chmod +x /usr/local/nagios/libexec/check_drivesize_wrapper.sh
chown apache.nagios /usr/local/nagios/libexec/check_drivesize_wrapper.sh
3. Now test it:

Code: Select all

/usr/local/nagios/libexec/check_drivesize_wrapper.sh HOSTADDR DRIVELETTER WARNING CRITICAL

Code: Select all

/usr/local/nagios/libexec/check_drivesize_wrapper.sh 192.168.5.232 C 90 95
Let us know the results, you can always adjust the wrapper script even further if needed.


Thank you
ssm_mon
Posts: 19
Joined: Tue Feb 24, 2015 11:37 am

Re: «Status Information» doesn’t show drive status when it i

Post by ssm_mon »

Dear ssax & tgriep:

We are very grateful for your good suggestions (either the one regarding the use of SNMP or the one about «check_drivesize_wrapper» plugin) and will surely take advantage of them in the future.
Unfortunately, as we are trying to upgrade, as soon as possible, our Nagios from 3.0.6 to 4.2.4, at the moment we don’t have much time to test something new, except minor changes to the syntax used.
We never thought that our problem (the lack of service status when status is OK) was a bug: we were almost sure that it could be solved with a little change in the syntax…

When you say «If you don't want to wait for the developer at nsclient.org» or «NSClient++ developers will need to fix it»:
1. Do you mean that you have reported the problem to the NSClient++ team?
2. If the answer to the previous question is yes, have you any idea about the time it will take to be solved?

To complete this message, we would like to report a strange thing that happened recently, when we were using this Forum.
As you can see in the attached image, we created two topics on April 24, between 9:47 and 9:53 am. The one about the lack of service status when status is OK disappeared mysterously as soon as it was created and never reappeared.
Is it possible that someone deleted our second topic thinking that it was equal to the first one?
In fact, syntaxes are completely different (one uses «check_drivesize» command and the other uses «check_service» command) although the problem is similar: in both cases, status is not showed in Status Information, when status is OK.

So, we will seize this opportunity to repeat the contents of our second topic, that disappeared mysterously:

Topic name: Nagios «Status Information» doesn’t show the service status when status is OK
Hello,
We use Nagios Core 4.2.4 and plugin check_npre 3.0.1, with NSClient++ 0.5.0.62 running on Windows servers.
When we check a single Windows service, we want to obtain the following data in Status Information: status (OK, Warning, Critical), Service name (Tomcat7, Workstation, etc.), service state (running, stopped) and service start type (auto, delayed, demand, disabled).
We are using the following syntax:

./check_nrpe -H <host address> -c check_service -a show-all service=<service name>

Unfortunately, with this syntax, «Status Information» doesn’t show status when it’s OK, although it shows status when it’s «Warning» or «Critical». Here are Status Information examples in these 3 different situations:
  • Workstation=running (auto)
    WARNING: , delayed (clr_optimization_v4.0.30319_32=stopped (delayed))
    CRITICAL: BMR Boot Service=stopped (auto), delayed ()
We use the «show-all» option, to obtain data on the service if status is OK. If this option is not used and status is OK, «Status Information» is «OK: All 1 service(s) are ok.».
We tried to add the «%(status)» variable to the «detail-syntax option» ("detail-syntax=%(status): %(name)=%(state) (%(start_type))"), but the result was not satisfactory when status is not OK (notice «OK» appearing after WARNING and CRITICAL status):
  • OK: Workstation=running (auto)
    WARNING: , delayed (OK: clr_optimization_v4.0.30319_32=stopped (delayed))
    CRITICAL: OK: BMR Boot Service=stopped (auto), delayed ()
Can someone help us please?
Thanks in advance!»
Attachments
NagiosSupportForum.png
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: «Status Information» doesn’t show drive status when it i

Post by tacolover101 »

ssm_mon wrote:Dear ssax & tgriep:
When you say «If you don't want to wait for the developer at nsclient.org» or «NSClient++ developers will need to fix it»:
1. Do you mean that you have reported the problem to the NSClient++ team?
2. If the answer to the previous question is yes, have you any idea about the time it will take to be solved?
the nagios developers did not write nsclient, so you would need to pass the information on to them. i don't think nagios will be able to inform you of how someone else will schedule their time.

i've seen some success in downgrading your NSClient++ versions, or upgrading, but very inconsistent results across the board. personally, i think NCPA is greater, and should be considered as a replacement - https://www.nagios.org/ncpa/
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: «Status Information» doesn’t show drive status when it i

Post by dwhitfield »

WMI is also an option if you do not want to wait for the NSClient devs.

To recap, SNMP and NCPA are also options.
ssm_mon
Posts: 19
Joined: Tue Feb 24, 2015 11:37 am

Re: «Status Information» doesn’t show drive status when it i

Post by ssm_mon »

Dear ssax, tgriep, tacolover101, dwhitfield:
Thanks again for all your good suggestions, but as we are trying to upgrade, as soon as possible, our Nagios from 3.0.6 to 4.2.4, at the moment we don’t have much time to test something new, except minor changes to the syntax used.

Dear tacolover101:
In your message, you say «the nagios developers did not write nsclient, so you would need to pass the information on to them».
We understand what you say, the problem is: how to do it?
1. We created 2 topics at http://forums.nsclient.org/ 12 days ago, with no reply;
2. We opened 1 issue at https://github.com/mickem/nscp/issues 4 days ago, with no reply yet.
Can you suggest any other way of passing information to NSClient developers?
Thanks in advance!
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: «Status Information» doesn’t show drive status when it i

Post by dwhitfield »

Looks like they haven't done anything in 14 days: https://github.com/mickem/nscp/issues/409

NSClient is really just one person, so you'll need to:
1. wait on him
2. use NCPA (ours)
3. use SNMP (been around since the paleolithic era)
4. use WMI (backed by MSFT), or
5. modify the code yourself.
Locked