Page 1 of 2

Service OK whereas not OK

Posted: Fri Dec 22, 2017 10:58 am
by Frédéric GRANAT
Hi,
A service on disk space doesn't alert whereas there is no left space on disk E: :

OK - C: Total=59.66GB, Used=16.27GB (27.3%), Free=43.39GB (72.7%) OK - D: Total=60.00GB, Used=-35.42GB (-59.0%), Free=95.42GB (159.0%) OK - E: Total=450.00GB, Used=450.00GB (100.0%), Free=0.00GB (0.0%) OK - F: Total=25.00GB, Used=3.51GB (14.0%

[[email protected] ~]# /usr/local/nagios/libexec/check_wmi_plus.pl -H xxxxxxxxx -u domcompta/xxxxxx -p dsisvc -m checkdrivesize -a 'C|D|E|Q|H|I|L|M|N' -w _FreeGB=20G -c _FreeGB=10G
OK - C: Total=59.66GB, Used=16.27GB (27.3%), Free=43.39GB (72.7%) OK - D: Total=60.00GB, Used=-35.42GB (-59.0%), Free=95.42GB (159.0%) OK - E: Total=450.00GB, Used=450.00GB (100.0%), Free=0.00GB (0.0%) OK - F: Total=25.00GB, Used=3.51GB (14.0%), Free=21.49GB (86.0%) |'C: Space'=16.27GB; 'C: Utilisation'=27.3%; 'D: Space'=-35.42GB; 'D: Utilisation'=-59.0%; 'E: Space'=450.00GB; 'E: Utilisation'=100.0%; 'F: Space'=3.51GB; 'F: Utilisation'=14.0%;

Do you have any idea ?

Rgds,

Frederic

Re: Service OK whereas not OK

Posted: Fri Dec 22, 2017 11:30 am
by dwhitfield
I don't know if this is going to work over wmi. Is it possible to use nsclient? You'll need to start with https://assets.nagios.com/downloads/nag ... ios-XI.pdf . After that, you'll need to take a look at https://assets.nagios.com/downloads/nag ... ios-XI.pdf .

Then, you can check from the command line with

Code: Select all

./check_nrpe -H <IP> -c CheckDriveSize -a 'FilterType=FIXED CheckAll MinWarn=20% MinCrit=5%'
If that doesn't work, can you post here the service you create? Then, can you PM me your Profile? You can download it by going to Admin > System Config > System Profile and click the ***Download Profile*** button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.

You can also generate a profile manually using the script at /usr/local/nagiosxi/html/includes/components/profile/getprofile.sh

That should generate a profile in /usr/local/nagiosxi/var/components/ which you can get off the server with an application such as FileZilla.

After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.

If you get an error that PROFILE BUILD FAILED, please see https://support.nagios.com/kb/article.p ... ategory=44

Re: Service OK whereas not OK

Posted: Fri Dec 22, 2017 11:41 am
by kyang
I was playing around with the thresholds, and I also found this in the --help option.

Code: Select all

EXAMPLES WITH MULITPLE SPECIFICATIONS
 for MODE=checkdrivesize:
 -w _UsedGB=10 -w 15 -w _Free%=5: -c _UsedGB=20 -c _Used%=25  
 This will generate a warning if 
    - the Used GB on the drive is more than 10 or 
    - the used % of the drive is more than 15% or
    - the free % of the drive is less than 5%
It looks like the thresholds for checkdrivesize is looking for an integer only.

Here are my examples.

Code: Select all

[root@localhost libexec]# /usr/local/nagios/libexec/check_wmi_plus.pl -H 192.168.3.46 -u xxx/xxx -p xxx -m checkdrivesize -a 'A|C' -w _FreeGB=250 -c _FreeGB=465
CRITICAL - [Triggered by _FreeGB>465] - A: Total=465.75GB, Used=0.10GB (0.0%), Free=465.65GB (100.0%)     WARNING - [Triggered by _FreeGB>250] - C: Total=451.93GB, Used=200.12GB (44.3%), Free=251.81GB (55.7%)     |'A: Space'=0.10GB; 'A: Utilisation'=0.0%; 'C: Space'=200.12GB; 'C: Utilisation'=44.3%;


[root@localhost libexec]# /usr/local/nagios/libexec/check_wmi_plus.pl -H 192.168.3.46 -u xxx/xxx -p xxx -m checkdrivesize -a 'A|C' -w _FreeGB=250G -c _FreeGB=465G
OK - A: Total=465.75GB, Used=0.10GB (0.0%), Free=465.65GB (100.0%)     OK - C: Total=451.93GB, Used=200.12GB (44.3%), Free=251.81GB (55.7%)     |'A: Space'=0.10GB; 'A: Utilisation'=0.0%; 'C: Space'=200.12GB; 'C: Utilisation'=44.3%;
1st example works, but using the same example likes your didn't work.

Using thresholds like this -w _FreeGB=250 -c _FreeGB=465 will work.

Try that out, and let us know if that worked for you.

Re: Service OK whereas not OK

Posted: Mon Feb 12, 2018 9:21 am
by Frédéric GRANAT
Hi,
Thanks and sorry for the delay, I applied the changes you proposed.
I will wait and see if that solves my problem.

Rgds,

Frederic

Re: Service OK whereas not OK

Posted: Mon Feb 12, 2018 9:44 am
by Frédéric GRANAT
Hi,
The solution of setting _FreeGB=20 -c _FreeGB=10 by example doesn't work : all the checks show critical alert.

Rgds,

Frederic

Re: Service OK whereas not OK

Posted: Mon Feb 12, 2018 10:39 am
by kyang
I'm sorry, it was supposed to be a "G" after the integers.

Code: Select all

 -w _FreeGB=250G -c _FreeGB=465G

Code: Select all

/usr/local/nagios/libexec/check_wmi_plus.pl -H 192.168.3.242 -u xxx/xxx -p xxx -m checkdrivesize -a 'A|C' -w _FreeGB=250G -c _FreeGB=465G
OK - A: Total=465.75GB, Used=0.10GB (0.0%), Free=465.65GB (100.0%)     OK - C: Total=451.93GB, Used=227.67GB (50.4%), Free=224.26GB (49.6%)     |'A: Space'=0.10GB; 'A: Utilisation'=0.0%; 'C: Space'=227.67GB; 'C: Utilisation'=50.4%;

Re: Service OK whereas not OK

Posted: Mon Feb 12, 2018 11:14 am
by Frédéric GRANAT
Hi,
Yes but in that case we're back to the initial conditions of my problem.

Re: Service OK whereas not OK

Posted: Mon Feb 12, 2018 11:20 am
by kyang
The solution of setting _FreeGB=20 -c _FreeGB=10 by example doesn't work : all the checks show critical alert.
Isn't it suppose to be showing critical for all services? Your FreeGB thresholds are very low.

I must have been confused since it's been a while.

You're right. Could you rerun your command and show me the output. (Without the G)

Code: Select all

 /usr/local/nagios/libexec/check_wmi_plus.pl -H xxxxxxxxx -u domcompta/xxxxxx -p dsisvc -m checkdrivesize -a 'C|D|E|Q|H|I|L|M|N' -w _FreeGB=20 -c _FreeGB=10

Re: Service OK whereas not OK

Posted: Tue Feb 13, 2018 5:24 am
by Frédéric GRANAT
Hi,
Here it is (without "G"):

[root@nagiosxi libexec]# ./check_wmi_plus.pl -H xxxxxxxxx -u xxxxxxxxxx -p xxxxxxxx -m checkdrivesize -a 'C|D|E|Q|H|I|L|M|N' -w _FreeGB=20 -c _FreeGB=10
CRITICAL - [Triggered by _FreeGB>10] - C: Total=59.66GB, Used=15.29GB (25.6%), Free=44.37GB (74.4%) CRITICAL - [Triggered by _FreeGB>10] - D: Total=70.00GB, Used=-32.11GB (-45.9%), Free=102.11GB (145.9%) CRITICAL - [Triggered by _FreeGB>10] - E: Total=520.00GB, Used=342.66GB (65.9%), Free=177.34GB (34.1%) CRITICAL - [Triggered by _FreeGB>10] - F: Total=25.00GB, Used=1.77GB (7.1%), Free=23.22GB (92.9%) |'C: Space'=15.29GB; 'C: Utilisation'=25.6%; 'D: Space'=-32.11GB; 'D: Utilisation'=-45.9%; 'E: Space'=342.66GB; 'E: Utilisation'=65.9%; 'F: Space'=1.77GB; 'F: Utilisation'=7.1%;

and with "G"


[root@nagiosxi libexec]# ./check_wmi_plus.pl -H xxxxxxxxx -u xxxxxxxxxx -p xxxxxxxx -m checkdrivesize -a 'C|D|E|Q|H|I|L|M|N' -w _FreeGB=20G -c _FreeGB=10G
OK - C: Total=59.66GB, Used=15.29GB (25.6%), Free=44.37GB (74.4%) OK - D: Total=70.00GB, Used=-32.11GB (-45.9%), Free=102.11GB (145.9%) OK - E: Total=520.00GB, Used=342.66GB (65.9%), Free=177.34GB (34.1%) OK - F: Total=25.00GB, Used=1.77GB (7.1%), Free=23.22GB (92.9%) |'C: Space'=15.29GB; 'C: Utilisation'=25.6%; 'D: Space'=-32.11GB; 'D: Utilisation'=-45.9%; 'E: Space'=342.66GB; 'E: Utilisation'=65.9%; 'F: Space'=1.77GB; 'F: Utilisation'=7.1%;

Re: Service OK whereas not OK

Posted: Tue Feb 13, 2018 11:43 am
by kyang
Thanks.

I'm a bit lost, are you checking for the GB space Free=102.11GB or are you wanting to check for the % of free space Free=102.11GB (145.9%) or something else?

Or do you mean that the service check is seeing it as all critical even if some hard drives return OK?

Code: Select all

./check_wmi_plus.pl -H 192.168.3.242 -u xx -p xx -m checkdrivesize -a 'A|C' -w _FreeGB=230 -c _FreeGB=240

Code: Select all

CRITICAL - [Triggered by _FreeGB>240] - A: Total=465.75GB, Used=0.10GB (0.0%), Free=465.65GB (100.0%)     

OK - C: Total=451.93GB, Used=231.67GB (51.3%), Free=220.26GB (48.7%)     |'A: Space'=0.10GB; 'A: Utilisation'=0.0%; 'C: Space'=231.67GB; 'C: Utilisation'=51.3%;
My drive A is critical, but my drive C is OK. It is strange, since I have 465.65GB/100% free space on A, but it says critical...

Is this what you mean?