NRPE: Command 'check_all_other_drives' not defined

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
veenm
Posts: 148
Joined: Tue Jun 18, 2013 5:58 am

NRPE: Command 'check_all_other_drives' not defined

Post by veenm »

Hi ,

I am using 0.3.8 nclient version and i have defined below command , but when i execute this command from nagios i am getting below error.

[/settings/external scripts/alias]
check_all_other_drives = CheckDriveSize CheckAllOthers FilterType=FIXED MinWarn=$ARG1$ MinCrit=$ARG2$ Drive=C

[/settings/NRPE/server]
allow arguments = true
allow nasty characters = true

From nagios:-

NRPE: Command 'check_all_other_drives' not defined


2. Please let me know how to monitor system uptime using check_uptime in nsclient++ and passing threshold in minutes.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE: Command 'check_all_other_drives' not defined

Post by tgriep »

To check your Windows system from the Nagios server, you would use the check_nrpe plugin to connect to the Windows system and that check would pass the command/arguments for the check_all_other_drives. Here is how you would do this.

In your commands.cfg file, you will need to have the check_nrpe command defined as follows

Code: Select all

define command {
       command_name                             check_nrpe
       command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
Your service check for all other drives would be defined like this

Code: Select all

 check_command                   check_nrpe!check_all_other_drives!-a 80 90!!!!!!
On your second question about uptime, you want to monitor the uptime of a windows system?
The check_uptime plugin will not work for this but there is a built in uptime check in the NSClient++.
On your Nagios system you could use the following command to do that.

Code: Select all

check_nt -H <IP Address> -p 12489 -v UPTIME
Be sure to check out our Knowledgebase for helpful articles and solutions!
veenm
Posts: 148
Joined: Tue Jun 18, 2013 5:58 am

Re: NRPE: Command 'check_all_other_drives' not defined

Post by veenm »

Hi,

I have modified the ini file below and executed check_nrpe from nagios , however i am getting below error.

on ini file:-

check_uptime_boot = checkuptime MinCrit=$ARG1$


root@xxxx libexec]# ./check_nrpe -H xxxxxxx -c check_uptime_boot -a 12m
Invalid command line: unrecognised option 'MinCrit=12m'
help Show help screen (this screen)
help-pb Show help screen as a protocol buffer payload
show-default Show default values for a given command
help-short Show help screen (short format).
debug Show debugging information in the log
show-all Show debugging information in the log
filter= Filter which marks interesting items.
warning=uptime < 2d Filter which marks items which generates a warning state.
warn= Short alias for warning
critical=uptime < 1d Filter which marks items which generates a critical state.
crit= Short alias for critical.
ok= Filter which marks items which generates an ok state.
empty-state=ignored Return status to use when nothing matched filter.
perf-config= Performance data generation configuration
top-syntax=${status}: ${list} Top level syntax.
ok-syntax= ok syntax.
empty-syntax= Empty syntax.
detail-syntax=uptime: ${uptime}h, boot: ${boot} (UTC) Det

But if i execute the same command on windows server it is working fine . please let me know where i am going wrong
checkuptime MinCrit=12h

D w32system Created command: crit=uptime<=12h
C:\Program Files\NSClient++/nsclient.log could not be opened, Discarding: debug
Created command: crit=uptime<=12h
L cli CRITICAL: CRITICAL: uptime: 10:40h, boot: 2015-Jun-26 09:50:58 (UT
)
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NRPE: Command 'check_all_other_drives' not defined

Post by Box293 »

Seems to be working for me on NSClient++ 0.3.8.76:

Code: Select all

[External Alias]
check_uptime_boot = checkuptime MinCrit=$ARG1$

Code: Select all

./check_nrpe -H win2008r2-01 -c check_uptime_boot -a 12m
CRITICAL: uptime: 0:3 < critical|'uptime'=187000;0;720000;
Please post your nsc.ini file
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked