[Nagiosplug-devel] check_mrtg command is returning STATE_UNKNOWN	when the state is ok
    Aigor Kajones 
    kajones_irc at hotmail.com
       
    Thu May 14 12:24:00 CEST 2009
    
    
  
Hi! 
I’m checking cpu status 
using check_mrtg command and i always get STATE_UNKNOWN when the state is Ok. I 
have modified the check_mrtg.c file like this:
 int main (int argc, char **argv) {        /* int result = STATE_UNKNOWN; */        int result = STATE_OK;        FILE *fp;        int line;        char input_buffer[MAX_INPUT_BUFFER]; etc…
 But the problem is not 
solved, I always get the service status like this: 
CPU LOAD VIA 
MRTG
 
UNKNOWN
05-14-2009 11:35:31
0d 0h 11m 27s
5/5
Max. value = 
1 
 This is what I have added 
at /usr/local/nagios/etc/objects/commands.cfg:
 # 'check_local_mrtgcpu' 
command definition
define 
command{
        command_name    
check_local_mrtgcpu
        command_line    
$USER1$/check_mrtg -F $ARG1$ -a $ARG2$ -v $ARG3$ -w $ARG4$ -c $ARG5$ -e 
$ARG6$
        }
 And the service added to 
/usr/local/nagios/etc/objects/switch.cfg:
 ################################################
# Monitor CPU LOAD on 
FIREWALL using MRTG GRAPHS
################################################
define 
service{
        
use                     generic-service ; Inherit values from a 
template
        
host_name               TICS_FIREWALL
        
service_description     CPU LOAD VIA MRTG
        
check_command           
check_local_mrtgcpu!/var/www/html/mrtg/172.17.17.3_cpu.log!MAX!1!90!75!5
        
max_check_attempts      5
        
check_interval          5
        
retry_interval          5
        
check_period            24x7
        
notification_interval   5
        
notification_period     24x7
        
notification_options    w,c,r
        
notifications_enabled   1
        
contact_groups          admins
        }
 What am I doing wrong?? The 
nagios plugins I’m using are 1.4.12 thanks very 
muchAiGoR!
_________________________________________________________________
Comparte, crea, disfruta… Descubre todo, en estos vídeos
http://www.windowslive.es 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20090514/11b2d3de/attachment.html>
    
    
More information about the Devel
mailing list