I have configured Nagios to monitor my Cisco switch Port and uptime
When i check logs i get below message
EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;core-switch;Port 1 Link Status;1385032075
EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;core-switch;Uptime;1385032818
But when i check the web interface i get
UNKNOWN External command error: Unknown flag passed to -C: i
UNKNOWN External command error: Unknown flag passed to -C: s
Below is the data mentioned in switch.cfg file
Port config
define service{
use generic-service ; Inherit values from a template
host_name core-switch ; The name of the host the service is associated with
hostgroup_name switches ; The name of the host the service is associated with
service_description Port 1 Link Status
check_command check_snmp! -C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
}
Uptime config
define service{
use generic-service ; Inherit values from a template
host_name core-switch ; The name of the host the service is associated with
hostgroup_name switches ; The name of the host the service is associated with
service_description Uptime
check_command check_snmp! -C public -o sysUpTime.0
}
Regards
Search
Port 1 Link Status
Re: Port 1 Link Status
Hi search4u2003,
Could you post your check_snmp in commands.cfg please? I think it defaults as "-C $ARG1$ -o $ARG2$ -r $ARG3$ -m $ARG4$", so you would only need in your service definition "check_command check_snmp!public!ifOperStatus.1!1!RFC1213-MIB".
Can't be sure, don't have access to Nagios at this moment, but would be worth double checking.
Kind Regards,
Gary Shergill
Could you post your check_snmp in commands.cfg please? I think it defaults as "-C $ARG1$ -o $ARG2$ -r $ARG3$ -m $ARG4$", so you would only need in your service definition "check_command check_snmp!public!ifOperStatus.1!1!RFC1213-MIB".
Can't be sure, don't have access to Nagios at this moment, but would be worth double checking.
Kind Regards,
Gary Shergill
Re: Port 1 Link Status
search4u2003, I think gshergill got it. The "i" and "s" unknown flags passed to -C seem to be the first letters after your -o flags. Your args are probably messed up.
Former Nagios employee
-
search4u2003
- Posts: 8
- Joined: Tue Jul 16, 2013 11:25 pm
Re: Port 1 Link Status
Thx
gshergill
tmcdonald
I found it where i was wrong.
im getting responce for ping now but for port 1 now im getting
UNKNOWN 11-22-2013 17:03:21 1d 1h 47m 14s 3/3 External command error: Error in packet
And this wht i get in nagios.log
EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;core-switch;Port 1 Link Status;1385119999
switch.cfg
define service{
use generic-service ; Inherit values from a template
host_name core-switch ; The name of the host the service is associated with
hostgroup_name switches ; The name of the host the service is associated with
service_description Port 1 Link Status
check_command check_snmp!ifOperStatus.1006 -r 1 -m RFC1213-MIB
snmp command
define command{
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C public -o $ARG1$ $ARG2$ $ARG3$
}
I have preadded community due to which i was getting precious error but now im getting above mentioned error
kindly check.
Regards
Search
gshergill
tmcdonald
I found it where i was wrong.
im getting responce for ping now but for port 1 now im getting
UNKNOWN 11-22-2013 17:03:21 1d 1h 47m 14s 3/3 External command error: Error in packet
And this wht i get in nagios.log
EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;core-switch;Port 1 Link Status;1385119999
switch.cfg
define service{
use generic-service ; Inherit values from a template
host_name core-switch ; The name of the host the service is associated with
hostgroup_name switches ; The name of the host the service is associated with
service_description Port 1 Link Status
check_command check_snmp!ifOperStatus.1006 -r 1 -m RFC1213-MIB
snmp command
define command{
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C public -o $ARG1$ $ARG2$ $ARG3$
}
I have preadded community due to which i was getting precious error but now im getting above mentioned error
kindly check.
Regards
Search
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Port 1 Link Status
When you manually run this check command from the command line what is returned?
-
search4u2003
- Posts: 8
- Joined: Tue Jul 16, 2013 11:25 pm
Re: Port 1 Link Status
Thx a lot for all your support it is working fine now but now i have one question.
I wan to monitor CPU usage not in percentage but used my top three application and same for memory can you people suggest some thing for it, bcoz i have been searching for it and dint find anything relevant yet.
Also how to define the command and service in the appropriate file.
Regards
Search
I wan to monitor CPU usage not in percentage but used my top three application and same for memory can you people suggest some thing for it, bcoz i have been searching for it and dint find anything relevant yet.
Also how to define the command and service in the appropriate file.
Regards
Search
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Port 1 Link Status
There is not a plugin that I know of that monitors a specific process's CPU and memory usage since this would be "in most cases" logistically useless information. The reason being is those values fluctuate so violently on normal workstations/servers that the information would be nearly useless as one moment you may be in an OK state, the next you could be in a critical for a matter of seconds, then be back in an OK state for days on end. Since Memory and CPU usage is in use by so many objects on the device it can fluctuate but have no specific correlation with a specific process.