Page 4 of 6

Re: Plugins Helps

Posted: Wed Jul 27, 2016 7:14 pm
by Box293
NSClient++ needs some options enabled to allow arguments.

Follow the steps in this link under "Configure NSClient++"
http://sites.box293.com/nagios/guides/n ... dows/0-4-x

Once you've done that then the command you tried should work fine.
kwhogster wrote:Do I create this command in the nrpe.cfg file?
Once you've got it working from the command line then you'll need to update your service definition, something like:

Code: Select all

check_command check_nrpe!CheckDriveSize!-a Showall MinWarn=10G MinCrit=5G checkall perf-unit=g

Re: Plugins Helps

Posted: Wed Jul 27, 2016 7:41 pm
by kwhogster
I updated my NSCLIENT.INI

added this
[/settings/nrpe/server]
allow arguments=1

restarted nscp service then from the server I ran this

root@TGCS017:/usr/lib/nagios/plugins# ./check_nrpe -H 10.2.8.69 -t 30 -c CheckDriveSize -a ShowAll MinWarn=20% MinCrit=10% Drive=C: perf-unit=G
OK: C:: 114G|'C: %'=81%;20;10 'C:'=114.18G;116.29;58.14;0;581.48


So that looks good

So then I added this

NRPE.CFG

define service {
host_name TGKW001
service_description Check Disk Usage
check_command check_nrpe!CheckDriveSize! -a ShowAll MinWarn=10G MinCrit=5G checkall perf-unit=G
check_interval 1
use generic-service
}

restarted Nagios

now getting this critical error

07-27-2016 20:40:44 0d 0h 11m 7s 3/3 Missing argument(s).

Thoughts


Another thing that looks strange to me when I edit the nrpe.cfg this line

check_command check_nrpe!CheckDriveSize! -a ShowAll MinWarn=20% MinCrit=10% Drive=C: perf-unit=G
using VI editor everything after the MinWarn= is in PURPLE color


Does that mean I am missing something I will attached the file

Re: Plugins Helps

Posted: Wed Jul 27, 2016 10:00 pm
by kwhogster
update

I modified the /etc/Nagios/nrpe.cfg file

dont_blame_nrpe=1 was dont_blame_nrpe=0

Now getting this error

CRITICAL: Could not get free space for: -a ShowAll MinWarn -a ShowAll MinWarn reason: 3: The system cannot find the path specified.

Re: Plugins Helps

Posted: Wed Jul 27, 2016 10:25 pm
by Box293
Looking back at your post, your command definition is something like:

Code: Select all

define command{
command_name check_nrpe
command_line /usr/lib/nagios/plugins/check_nrpe.cfg -H '$HOSTADDRESS$' -c '$ARG1$'
}
The service I asked you to define has:

Code: Select all

check_command check_nrpe!CheckDriveSize! -a 'ShowAll MinWarn=10G MinCrit=5G checkall perf-unit=G'
Which means:

Code: Select all

$ARG1$ = CheckDriveSize
$ARG2$ = -a 'ShowAll MinWarn=10G MinCrit=5G checkall perf-unit=G'
$ARG2$ is not being passed because the command does not have a second argument (the ! separate the arguments). Change your command definition to this:

Code: Select all

define command{
command_name check_nrpe
command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$
}
Note: I also remove the single quotes.

Does this work?

Re: Plugins Helps

Posted: Wed Jul 27, 2016 10:41 pm
by kwhogster
That did it

Now have no Errors

Great job

Now have to modify all other computers NSCLIENT.INI and then I can add the rest of them to the config


I will post results


OOOOOPS I replied tooo fast It was successful first go around now I am getting this error

(Return code of 13 is out of bounds)



Event Start Time

Event End Time

Event Duration

Event/State Type

Event/State Information

07-27-2016 20:33:46 07-27-2016 20:34:34 0d 0h 0m 48s SERVICE CRITICAL (HARD) Missing argument(s).
07-27-2016 23:34:42 07-27-2016 23:39:03 0d 0h 4m 21s SERVICE OK (HARD) OK: C:: Total: 581G - Used: 114G (19%) - Free: 467G (81%)
07-27-2016 23:43:42 07-27-2016 23:44:18 0d 0h 0m 36s+ SERVICE CRITICAL (HARD) (Return code of 13 is out of bounds)


Thoughts

Re: Plugins Helps

Posted: Wed Jul 27, 2016 10:57 pm
by kwhogster
I did a chmod 755 on check_nrpe.cfg

Now I am getting this error

(No output on stdout) stderr: /usr/lib/nagios/plugins/check_nrpe.cfg: 2: /usr/lib/nagios/plugins/check_nrpe.cfg: define: not found


so close but yet so far

Any ides?

Thanks

Re: Plugins Helps

Posted: Thu Jul 28, 2016 1:11 am
by Box293
This thread has been going on so long I accidentally copied the original incorrect command definition. Here is the correct one (I removed .cfg)

Code: Select all

define command{
command_name check_nrpe
command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$
}

Re: Plugins Helps

Posted: Thu Jul 28, 2016 8:22 pm
by kwhogster
Box923

That worked no issues all Day

I have just one more question on this

I have several servers with more than one drive and I added them to my cfg file but I got duplicate warnings on all of them

root@TGCS017:/usr/lib/nagios/plugins# /usr/local/nagios/bin/nagios -vv /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/localhost.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/windows.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/computer.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/switch.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/printer.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/nrpe.cfg'...
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS025' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 260)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS025' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 253)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS025' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 246)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS016' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 232)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS016' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 225)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS014' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 204)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS013' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 190)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS013' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 183)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS013' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 176)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS013' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 169)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS012' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 155)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS012' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 148)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS012' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 141)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS011' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 127)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS011' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 120)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS010' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 106)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS010' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 99)
Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS010' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 92)
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 728 services.
Checked 25 hosts.
Checked 5 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 1 contact groups.
Checked 25 commands.
Checked 6 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 25 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 6 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check


It works well with the Drive=C:

How do I check the other drives?

Thanks

Tom



Update

After adding on my computers to this all worked except for two of them both of them are 32 bit computers one is Windows XP Pro the other is Windows 2003 Server

Get this error CHECK_NRPE: Error - Could not complete SSL handshake.

Does NRPE work with 32 bit computers?

ran this from console

root@TGCS017:/usr/lib/nagios/plugins# ./check_nrpe -H 10.2.8.75 -t 30 -c CheckDriveSize -a ShowAll=long MinWarn =20% MinCrit=10% Drive=C: perf-unit=G
CHECK_NRPE: Error - Could not complete SSL handshake.
root@TGCS017:/usr/lib/nagios/plugins# ./check_nrpe -H 10.2.8.12 -t 30 -c CheckDriveSize -a ShowAll=long MinWarn =20% MinCrit=10% Drive=C: perf-unit=G
CHECK_NRPE: Error - Could not complete SSL handshake.



Thanks

Re: Plugins Helps

Posted: Thu Jul 28, 2016 10:49 pm
by Box293
kwhogster wrote:I have several servers with more than one drive and I added them to my cfg file but I got duplicate warnings on all of them
kwhogster wrote:Warning: Duplicate definition found for service 'Check Disk Usage' on host 'TGCS025' (config file '/usr/local/nagios/etc/objects/nrpe.cfg', starting on line 260)
kwhogster wrote:It works well with the Drive=C:

How do I check the other drives?
The service_description is the unique identifier. Your services for different drives should have different descriptions. Try:

Code: Select all

service_description Check Disk Usage C:
service_description Check Disk Usage D:
service_description Check Disk Usage E:
Then there won't be duplicates.
kwhogster wrote:Update

After adding on my computers to this all worked except for two of them both of them are 32 bit computers one is Windows XP Pro the other is Windows 2003 Server

Get this error CHECK_NRPE: Error - Could not complete SSL handshake.

Does NRPE work with 32 bit computers?
Yes it does. What version of NSClient++ did you install on these computers?

Re: Plugins Helps

Posted: Thu Jul 28, 2016 11:25 pm
by kwhogster
Box293

Great catch on the service name that worked making the changes now.


The NSCLIENT version of 32 bit is

NSCP-0.4.3.143

I ran this on all machines

Type cd "\Program Files\NSClient++\" and press Enter
?Type nscp settings --activate-module NRPEServer --add-defaults and press Enter

nscp settings --activate-module NRPEServer --add-defaults

?This may prompt you for permission
?Type nscp settings --path /settings/NRPE/server --key "allow arguments" --set true and press Enter

nscp settings --path /settings/NRPE/server --key "allow arguments" --set true

?This may prompt you for permission
?Type nscp settings --path /settings/NRPE/server --key "allow nasty characters" --set true and press Enter

nscp settings --path /settings/NRPE/server --key "allow nasty characters" --set true

?This may prompt you for permission

?IF this is NSClient++ 0.4.3 onwards

?Type nscp settings --path /settings/NRPE/server --key insecure --set true and press Enter

nscp settings --path /settings/NRPE/server --key insecure --set true

?This may prompt you for permission

net stop nscp

net start nscp

All 64 bit clients are NSCP 0.4.1.73


I ran this on the 32 bit computers

?IF this is NSClient++ 0.4.3 onwards

?Type nscp settings --path /settings/NRPE/server --key insecure --set true and press Enter

nscp settings --path /settings/NRPE/server --key insecure --set true


Thoughts