Page 1 of 2

check_nrpe check_drivesize is not using crit and warn

Posted: Thu Sep 07, 2017 4:01 pm
by jmajor
Hello,

I inherited Nagios Core 3.5.1 monitoring windows servers for various things and I ran into a small issue which I'm not able to figure out.

On one of my Windows 2008 servers, one of the drives ran out of space, but it never notified at the warning level or at the critical level.

The command running in the service to monitor that particular system/drive is:
/usr/lib64/naghios/plugins/check_nrpe -c checkdrivesize -H 10.10.10.10 -a 'crit=free<5g" "warn=free<8g" drive=d:

when I run the 'Run Check Plugin' the Plugin Output is: OK All 1 drive (s) asre ok|'d: free'=640KB;0.00781;0.00488;0;2147349448 'd: free %'=0%;0;0;0;100

Why is reporting OK when the free space is below warning and critical levels?

I'm extremely new to this, and this is the first time I've had to investigate the maintenance that this has been running effortlessly for me.

Re: check_nrpe check_drivesize is not using crit and warn

Posted: Thu Sep 07, 2017 4:29 pm
by dwhitfield
This could be a typo, but you have a quotation mark mismatch.

Can you try with percentages and see if that works? I don't believe all versions allow for that syntax.

Please post your nsclient.ini. If you find you have a NSC.ini rather than nsclient.ini, that is a sign you need to upgrade your nsclient. When doing so, you'll need to follow https://assets.nagios.com/downloads/nag ... ios-XI.pdf . Even though it says XI, all of the stuff on the NSClient side is the same, which is what you need it for.

Also, if you are using version .5 of NSClient, I would suggest downgrading to .4.4, as we do not have documentation for .5.

I doubt this is going to end up mattering, but on what OS are you running Nagios Core?

Lastly, what is the output of /usr/lib64/naghios/plugins/check_nrpe -H

Re: check_nrpe check_drivesize is not using crit and warn

Posted: Fri Sep 08, 2017 9:58 am
by jmajor
The one item was a typo, apologies.

Answers in no particular order:

0) I can try adjusting it to percentages. We adjusted the space on the drive so it's not at a state where it will warn me at the moment, however.

3) Running /usr/lib64/nagios/plugins/check_nrpe -H 10.10.10.10 returns: I (0.4.3.143 2015-04-29) seems to be doing fine...

2) The OS is CentOS 2.6.32-573

1) NSC.ini listed below

---[modules]
CheckSystem.dll
CheckDisk.dll
NRPEListener.dll
CheckEventLog.dll
CheckExternalScripts.dll
CheckWMI.dll
NSClientListener.dll

[Settings]
use_file=1


[NRPE]
allow_arguments=1
allow_nasty_meta_chars=1
use_ssl=1

[Check System]
CPUBufferSize=1h
CheckResolution=10
;check_all_services[SERVICE_BOOT_START]=ignored
;check_all_services[SERVICE_SYSTEM_START]=ignored
check_all_services[SERVICE_AUTO_START]=started
;check_all_services[SERVICE_DEMAND_START]=ignored
;check_all_services[SERVICE_DISABLED]=stopped

[External Script]
allow_arguments=0
allow_nasty_meta_chars=0

[External Scripts]
get_disks=scripts/df.exe -b -r
get_time=scripts/date.exe +%s
get_netstat=netstat -an
get_ifconfig=ipconfig /all
get_systeminfo=systeminfo
get_computername=hostname

check_ad=cmd /c scripts\check_ad\check_ad.exe --dc
check_hpacucli=cmd /c scripts\check_hpacucli\check_hpacucli.exe
[External Alias]

[log]

[NSClient]


[includes]
local.ini
allowed_hosts.ini
check_certificates.ini
exchange.ini

---


Thanks in advance.

Re: check_nrpe check_drivesize is not using crit and warn

Posted: Fri Sep 08, 2017 10:38 am
by jmajor
Sorry,

Additional help. What would be the best syntax to adjust the check

Commandline is currently:
$USER1$/check_nrpe -c check_drivesize -H 10.10.10.10 -a "crit=free<5g" "warn=free<8g" drive=d:

is it as simple as changing it to "crit=free<5%" warn=free<8%"?

Re: check_nrpe check_drivesize is not using crit and warn

Posted: Fri Sep 08, 2017 12:44 pm
by dwhitfield
jmajor wrote:
is it as simple as changing it to "crit=free<5%" warn=free<8%"?
Obviously, you need to make sure those are the critical and free you want, but otherwise, yes.

Re: check_nrpe check_drivesize is not using crit and warn

Posted: Fri Sep 08, 2017 2:39 pm
by jmajor
I made the change but I receieved a 'Fatal: /usr/share/okconfig/templates/windows/commands.cfg is outside repository

Re: check_nrpe check_drivesize is not using crit and warn

Posted: Fri Sep 08, 2017 2:49 pm
by dwhitfield
Can you show us a screenshot of where you see that error? That doesn't look like a nagios error to me. Are you using adagios or something like that?

Also, can you post your nagios.cfg file?

lastly, what is the output of rpm -qa | grep nagios?

Re: check_nrpe check_drivesize is not using crit and warn

Posted: Mon Sep 11, 2017 8:45 am
by jmajor
Ahh yes, I am running Adagios overtop of Nagios, I hadn't realized that.

I was in the web gui interface trying to edit the command 'okc-windows-chcek_disk_D'. I am not the root user, which is the owner of the config file that had a fit: /usr/share/okconfig/templates/windows/commands.cfg

I've attached the nagios.cfg which was found in /etc/nagios



------output of rpm -qa | grep nagios----------------

nagios-plugins-nrpe-2.15-7.el6.x86_64
nagios-plugins-sensors-2.0.3-3.el6.x86_64
nagios-okplugin-check_disks-1.0.7-1.git.0.f986b73.el6.noarch
nagios-plugins-breeze-2.0.3-3.el6.x86_64
nagios-plugins-ldap-2.0.3-3.el6.x86_64
nagios-plugins-dig-2.0.3-3.el6.x86_64
nagios-plugins-real-2.0.3-3.el6.x86_64
nagios-plugins-smtp-2.0.3-3.el6.x86_64
nagios-okplugin-mailblacklist-1.1-1.git.0.e9222eb.el6.noarch
nagios-plugins-flexlm-2.0.3-3.el6.x86_64
nagios-plugins-dns-2.0.3-3.el6.x86_64
nagios-plugins-disk-2.0.3-3.el6.x86_64
nagios-plugins-ups-2.0.3-3.el6.x86_64
nagios-plugins-dummy-2.0.3-3.el6.x86_64
nagios-plugins-2.0.3-3.el6.x86_64
nagios-plugins-ping-2.0.3-3.el6.x86_64
nagios-plugins-snmp-2.0.3-3.el6.x86_64
nagios-plugins-ntp-perl-2.0.3-3.el6.x86_64
nagios-plugins-wave-2.0.3-3.el6.x86_64
nagios-plugins-ide_smart-2.0.3-3.el6.x86_64
nagios-plugins-dhcp-2.0.3-3.el6.x86_64
nagios-plugins-tcp-2.0.3-3.el6.x86_64
nagios-plugins-mysql-2.0.3-3.el6.x86_64
nagios-plugins-mrtg-2.0.3-3.el6.x86_64
nagios-plugins-icmp-2.0.3-3.el6.x86_64
nagios-plugins-overcr-2.0.3-3.el6.x86_64
nagios-plugins-disk_smb-2.0.3-3.el6.x86_64
nagios-3.5.1-1.el6.x86_64
nagios-plugins-pgsql-2.0.3-3.el6.x86_64
nagios-okplugin-check_uptime-1.0.1-1.el6.x86_64
nagios-plugins-perl-2.0.3-3.el6.x86_64
nagios-plugins-rpc-2.0.3-3.el6.x86_64
nagios-plugins-file_age-2.0.3-3.el6.x86_64
nagios-plugins-time-2.0.3-3.el6.x86_64
nagios-plugins-nagios-2.0.3-3.el6.x86_64
nagios-plugins-swap-2.0.3-3.el6.x86_64
nagios-plugins-nwstat-2.0.3-3.el6.x86_64
nagios-plugins-mrtgtraf-2.0.3-3.el6.x86_64
nagios-plugins-ntp-2.0.3-3.el6.x86_64
nagios-plugins-by_ssh-2.0.3-3.el6.x86_64
nagios-plugins-users-2.0.3-3.el6.x86_64
nagios-okplugin-check_time-1.0.3-1.git.0.5f604b8.el6.x86_64
nagios-plugins-fping-2.0.3-3.el6.x86_64
pnp4nagios-0.6.22-2.el6.x86_64
nagios-plugins-mailq-2.0.3-3.el6.x86_64
nagios-plugins-oracle-2.0.3-3.el6.x86_64
nagios-plugins-procs-2.0.3-3.el6.x86_64
nagios-plugins-hpjd-2.0.3-3.el6.x86_64
nagios-plugins-nt-2.0.3-3.el6.x86_64
nagios-okplugin-apc-2.1.2-1.git.0.03f7389.el6.noarch
nagios-plugins-game-2.0.3-3.el6.x86_64
nagios-plugins-all-2.0.3-3.el6.x86_64
nagios-common-3.5.1-1.el6.x86_64
nagios-plugins-ssh-2.0.3-3.el6.x86_64
nagios-plugins-ircd-2.0.3-3.el6.x86_64
nagios-plugins-load-2.0.3-3.el6.x86_64
nagios-plugins-http-2.0.3-3.el6.x86_64
nagios-plugins-cluster-2.0.3-3.el6.x86_64
nagios-plugins-log-2.0.3-3.el6.x86_64
nagios-okplugin-brocade-0.0.5-1.git.0.09dcc39.el6.x86_64
nagios-plugins-check_cpu-1.0-1.el6.noarch

Re: check_nrpe check_drivesize is not using crit and warn

Posted: Mon Sep 11, 2017 10:13 am
by scottwilkerson
jmajor wrote:Ahh yes, I am running Adagios overtop of Nagios, I hadn't realized that.
jmajor wrote:I was in the web gui interface trying to edit the command 'okc-windows-chcek_disk_D'. I am not the root user, which is the owner of the config file that had a fit: /usr/share/okconfig/templates/windows/commands.cfg
Not really familiar with Adagios, but if the error is in that config, and Adagios needs it fixed, you are going to have to work with the root user to fix the issue.

Re: check_nrpe check_drivesize is not using crit and warn

Posted: Mon Sep 11, 2017 4:29 pm
by jmajor
I built a new command, which let me successfully create the command the way that I wanted, tied that command to a new service. I added that service to monitoring that particular host.


I tested the warnings at a higher level than the drive's current free space, and received my notifications successfully.


This is resolved, thanks again for the help.