Status Information:DISK UNKNOWN

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.
sanjayk
Posts: 13
Joined: Mon Jun 09, 2014 11:35 am

Re: Status Information:DISK UNKNOWN

Post by sanjayk »

This script using snmp v3

[nagios@sov-srv-negios01 ~]$ grep snmpwalk /usr/local/nagios/libexec/check_disk_snmp
my @bulkget = `$SNMPDIR/snmpwalk -v3 -mALL -t 5 -r 3 -c $PASS $HOST hrStorage`;
[nagios@sov-srv-negios01 ~]$

Sanjay
sanjayk
Posts: 13
Joined: Mon Jun 09, 2014 11:35 am

Re: Status Information:DISK UNKNOWN

Post by sanjayk »

more details

On my nagios core server

[root@sov-srv-negios01 ~]# su - nagios
[nagios@sov-srv-negios01 ~]$ /usr/local/nagios/libexec/check_nrpe -H 10.128.132.17 -c check_sftp
DISK OK - free space: /sftp 46696 MB (99% inode=99%);| /sftp=183MB;39510;44449;0;49388
[nagios@sov-srv-negios01 ~]$

On my monitoring client

nrpe.cfg file

command[check_sftp]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /sftp
command[check_disk_snmp]=/usr/local/nagios/libexec/check_disk_snmp -t localhost -w 85% -c 95% -p public -x '^/' -i '/sftp'
[nagios@virginsftp01 ~]$

[nagios@ginsftp01 ~]$ /usr/local/nagios/libexec/check_disk_snmp -t 127.0.0.1 -w '80' -c '90' -p 'public' -x '^/' -i '/sftp'
DISK OK - free space: /sftp 51.6gb;
[nagios@ginsftp01 ~]$
sanjayk
Posts: 13
Joined: Mon Jun 09, 2014 11:35 am

Re: Status Information:DISK UNKNOWN

Post by sanjayk »

still cant understand why it say disk unknow same command I am manually say disk OK

when Run same command manually

[nagios@sov-srv-negios01 ~]$ /usr/local/nagios/libexec/check_disk_snmp -t 10.128.132.17 -w '85' -c '95' -p public -x 'public' -i '^/'
DISK OK - free space: /sftp 51.6gb; free space: /dev/shm 2.0gb; free space: /boot 334mb; free space: /var 6.7gb; free space: / 2.9gb;
[nagios@sov-srv-negios01 ~]$

Can some please tell me ehat format it will accept out put from plugin so that I will change script.

[1402440735.076199] [001.0] [pid=10380] process_macros_r()
[1402440735.076206] [2048.1] [pid=10380] **** BEGIN MACRO PROCESSING ***********
[1402440735.076215] [2048.1] [pid=10380] Processing: '/usr/local/nagios/libexec/check_disk_snmp -t $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p $USER3$ -x $ARG3$ -i $ARG4$'
[1402440735.076236] [2048.1] [pid=10380] Done. Final output: '/usr/local/nagios/libexec/check_disk_snmp -t 10.128.132.17 -w '85' -c '95' -p public -x 'public' -i '^/''
[1402440735.076245] [2048.1] [pid=10380] **** END MACRO PROCESSING *************
[1402440735.076255] [064.1] [pid=10380] Making callbacks (type 6)...
[1402440735.076272] [001.0] [pid=10380] macros_to_kvv()
[1402440735.076315] [001.0] [pid=10380] clear_volatile_macros_r()
[1402440735.076334] [001.0] [pid=10380] handle_timed_event() end
[1402440735.076343] [064.1] [pid=10380] Making callbacks (type 1)...
[1402440735.076352] [064.1] [pid=10380] Making callbacks (type 11)...
[1402440735.076360] [008.1] [pid=10380] ** Event Check Loop
[1402440735.076377] [008.1] [pid=10380] Next Event Time: Tue Jun 10 23:52:21 2014
[1402440735.076385] [008.1] [pid=10380] Current/Max Service Checks: 1/0 (inf% saturation)
[1402440735.076394] [12288.1] [pid=10380] ## Polling 1500ms; sockets=14; events=28; iobs=0x805140
[1402440735.171165] [001.0] [pid=10380] handle_async_service_check_result()
[1402440735.171211] [016.0] [pid=10380] ** Handling check result for service 'SFTP Partition' on host 'ginsftp01' from 'Core Worker 10384'...
[1402440735.171224] [016.1] [pid=10380] HOST: virginsftp01, SERVICE: SFTP Partition, CHECK TYPE: Active, OPTIONS: 0, SCHEDULED: Yes, RESCHEDULE: Yes, EXITED OK: Yes, RETURN CODE: 3, OUTPUT: DISK UNKNOWN

[1402440735.171242] [001.0] [pid=10380] get_service_check_return_code()
[1402440735.171252] [016.1] [pid=10380] Service is in a non-OK state!
[1402440735.171261] [016.1] [pid=10380] Host is currently UP, so we'll recheck its state to make sure...
[1402440735.171269] [001.0] [pid=10380] schedule_host_check()
[1402440735.171292] [016.0] [pid=10380] Scheduling a non-forced, active check of host 'ginsftp01' @ Tue Jun 10 23:52:15 2014
[1402440735.171321] [064.1] [pid=10380] Making callbacks (type 1)...
[1402440735.171332] [001.0] [pid=10380] add_event()
[1402440735.171342] [064.1] [pid=10380] Making callbacks (type 12)...
[1402440735.171360] [016.1] [pid=10380] Current/Max Attempt(s): 1/3
[1402440735.171370] [016.1] [pid=10380] Host is UP, so we'll retry the service check...
[1402440735.171450] [064.1] [pid=10380] Making callbacks (type 2)...
[1402440735.171463] [001.0] [pid=10380] handle_service_event()
[1402440735.171472] [064.1] [pid=10380] Making callbacks (type 23)...
[1402440735.171485] [001.0] [pid=10380] run_global_service_event_handler()
[1402440735.171504] [001.0] [pid=10380] clear_volatile_macros_r()
[1402440735.171532] [016.1] [pid=10380] Rescheduling next check of service at Tue Jun 10 23:54:15 2014
[1402440735.171543] [001.0] [pid=10380] get_next_valid_time()
[1402440735.171555] [001.0] [pid=10380] _get_matching_timerange()
[1402440735.171567] [001.0] [pid=10380] schedule_service_check()
[1402440735.171579] [016.0] [pid=10380] Scheduling a non-forced, active check of service 'SFTP Partition' on host 'ginsftp01' @ Tue Jun 10 23:54:15 2014
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Status Information:DISK UNKNOWN

Post by Box293 »

I think there are some concepts getting mixed up here. I know some of this might be obvious, but sometimes it's good to go back to basics.

check_disk_snmp is a plugin that allows you to check disk usage via SNMP. This is helpful for monitoring remote systems that do not have an agent (like nrpe).

NRPE is for agent based checking, it allows more flexibility by allowing you to run scripts (unlike SNMP). It also can add an administrative overhead because you need to install / configure the agent on each host your are monitoring.
sanjayk wrote:On my nagios core server

[root@sov-srv-negios01 ~]# su - nagios
[nagios@sov-srv-negios01 ~]$ /usr/local/nagios/libexec/check_nrpe -H 10.128.132.17 -c check_sftp
DISK OK - free space: /sftp 46696 MB (99% inode=99%);| /sftp=183MB;39510;44449;0;49388
[nagios@sov-srv-negios01 ~]$

On my monitoring client

nrpe.cfg file

command[check_sftp]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /sftp
command[check_disk_snmp]=/usr/local/nagios/libexec/check_disk_snmp -t localhost -w 85% -c 95% -p public -x '^/' -i '/sftp'
[nagios@virginsftp01 ~]$

[nagios@ginsftp01 ~]$ /usr/local/nagios/libexec/check_disk_snmp -t 127.0.0.1 -w '80' -c '90' -p 'public' -x '^/' -i '/sftp'
DISK OK - free space: /sftp 51.6gb;
[nagios@ginsftp01 ~]$
So when you are running this command from your Nagios host:
/usr/local/nagios/libexec/check_nrpe -H 10.128.132.17 -c check_sftp
It is being executed on the monitoring client. And your result shows this is working.

Assuming your command definition is:

Code: Select all

define command{
        command_name    check_nrpe
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
        }
Then the service definition for that would be something like:

Code: Select all

define service{
        use                     generic-service
        host_name               10.128.132.17
        service_description     check_sftp
        check_command           check_nrpe!check_sftp
        }
Question: Is this what you are after?

If so I would stop trying to use check_disk_snmp. Especially above where you are trying to execute it via check_nrpe, this is double handling.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rajesh.mehra
Posts: 35
Joined: Mon Jan 27, 2014 2:38 am
Location: New Delhi, India

Re: Status Information:DISK UNKNOWN

Post by rajesh.mehra »

Hi Sanjay

Which Linux distribution are you using on Nagios server and client.

I tested it on rhel5.4 and centos 6.5 but no issue

I used this plugin http://exchange.nagios.org/directory/Pl ... mp/details


[nagios@srv01~]$ /usr/local/nagios/libexec/check_disk_snmp -t 10.94.64.111 -w 85% -c 95% -p public -x '^/' -i '/export'
DISK OK - [25% full,23.8gb free on /export]
check_disk_snmp.PNG
check_disk_snmp.PNG (3.43 KiB) Viewed 4681 times
Did you change in plugin ?
Because there is difference in plugin output between your side and mine otherwise you are using another plugin.

--DISK OK - free space: /sftp 51.6gb;
--DISK OK - [25% full,23.8gb free on /export]


Tks
Rajesh Mehra
sanjayk
Posts: 13
Joined: Mon Jun 09, 2014 11:35 am

Re: Status Information:DISK UNKNOWN

Post by sanjayk »

Finally its working

My configuration are like this

Commands.cfg

define command{
command_name check_nrpe
command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}


Host.cfg.

define service{
use generic-service ; Name of service template to use
host_name virginsftp01
service_description SFTP Partition
check_command check_nrpe!check_sftp
}


[1402477223.774608] [2048.1] [pid=16258] Processing: '/usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$'
[1402477223.774623] [2048.1] [pid=16258] Done. Final output: '/usr/local/nagios/libexec/check_nrpe -H 10.128.132.17 -c check_sftp'
[1402477223.774639] [2048.1] [pid=16258] **** END MACRO PROCESSING *************
[1402477223.774651] [064.1] [pid=16258] Making callbacks (type 6)...
[1402477223.774668] [001.0] [pid=16258] macros_to_kvv()
[1402477223.774719] [001.0] [pid=16258] clear_volatile_macros_r()
[1402477223.774742] [001.0] [pid=16258] handle_timed_event() end
[1402477223.774751] [064.1] [pid=16258] Making callbacks (type 1)...
[1402477223.774762] [008.1] [pid=16258] ** Event Check Loop
[1402477223.774778] [008.1] [pid=16258] Next Event Time: Wed Jun 11 10:00:29 2014
[1402477223.774798] [008.1] [pid=16258] Current/Max Service Checks: 1/0 (inf% saturation)
[1402477223.774809] [12288.1] [pid=16258] ## Polling 1500ms; sockets=14; events=28; iobs=0x9b8140
[1402477223.798612] [001.0] [pid=16258] handle_async_service_check_result()
[1402477223.798674] [016.0] [pid=16258] ** Handling check result for service 'SFTP Partition' on host 'virginsftp01' from 'Core Worker 16263'...
[1402477223.798687] [016.1] [pid=16258] HOST: virginsftp01, SERVICE: SFTP Partition, CHECK TYPE: Active, OPTIONS: 0, SCHEDULED: Yes, RESCHEDULE: Yes, EXITED OK: Yes, RETURN CODE: 0, OUTPUT: DISK OK - free space: /sftp 46696 MB (99% inode=99%);| /sftp=183MB;39510;44449;0;49388
sanjayk
Posts: 13
Joined: Mon Jun 09, 2014 11:35 am

Re: Status Information:DISK UNKNOWN

Post by sanjayk »

Hi Rajesh

I am using Centos 6.5 on both client and server and its working now.

Thanks for suggestion

Sanjay
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Status Information:DISK UNKNOWN

Post by tmcdonald »

Closing thread.
Former Nagios employee
Locked