Page 1 of 1

Having trouble with check_openmanage plugin

Posted: Thu Dec 15, 2011 12:40 pm
by teknoratti
I've read the check_openmanage user guide about defining hosts, services, commands, etc.

My question is, I haven't figured out to add more commands other than the basic check_openmanage command that reads out memory and drive info shown below:

1/3 OK - System: 'PowerEdge 600SC', SN: 'F5DT721', 512 MB ram (1 dimms), 1 logical drives, 2 physical drives

I'm really having trouble getting the grasp of how the define command and define service command relate to each other. I've tried to use the various switches associated with the check_openmanage plugin but I don't know how to incorporate it into my .cfg file so that I can see it through the web console.

When trying to verify the .cfg file I get the following error:
Error: Service check command 'check_openmanage -H $HOSTADDRESS$ --only temp' specified in service 'Temperature' for host 'ddy-dc-0-02' not defined anywhere!

Below I have posted my openmanage.cfg file for further examination.


# Openmanage check via SNMP
define command {
command_name check_openmanage
command_line /usr/lib/nagios/plugins/check_openmanage -H $HOSTADDRESS$
}

# Openmanage check via SNMP
define command {
command_name check_openmanage -H $HOSTADDRESS$--only temp
command_line /usr/lib/nagios/plugins/check_openmanage -H $HOSTADDRESS$
}

#Dell OMSA status
define service{
use generic-service
hostgroup_name dell-servers
servicegroups dell-openmanage
service_description Dell OSMA
check_command check_openmanage
}

#Dell OMSA status
define service{
use generic-service
hostgroup_name dell-servers
servicegroups dell-openmanage
service_description HTML Info
check_command check_openmanage
}

#Dell TEMP status
define service{
use generic-service
hostgroup_name dell-servers
servicegroups dell-openmanage
service_description Temperature
check_command check_openmanage -H $HOSTADDRESS$ --only temp
}

Re: Having trouble with check_openmanage plugin

Posted: Thu Dec 15, 2011 5:04 pm
by jsmurphy
This was also my first great hurdle when learning Nagios. There are a couple of ways you can accomplish what you are after the easiest to understand would be this:

Code: Select all

# Openmanage check via SNMP
define command {
command_name check_openmanage_temperature
command_line /usr/lib/nagios/plugins/check_openmanage -H $HOSTADDRESS$ --only temp
}

#Dell TEMP status
define service{
use generic-service
hostgroup_name dell-servers
servicegroups dell-openmanage
service_description Temperature
check_command check_openmanage_temperature
}
I've moved the --only temp to the command line and changed the command name. The command_line is what is executed, the command name is just a reference name for nagios.

You could also do the following:

Code: Select all

# Openmanage check via SNMP
define command {
command_name check_openmanage
command_line /usr/lib/nagios/plugins/check_openmanage -H $HOSTADDRESS$ $ARG1$
}

#Dell TEMP status
define service{
use generic-service
hostgroup_name dell-servers
servicegroups dell-openmanage
service_description Temperature
check_command check_openmanage!--only temp
}
The ! operator in a check_command will tell it the proceeding text is an argument for the command. You may need to encase quotes around the --only temp but I don't think so in this instance.

Re: Having trouble with check_openmanage plugin

Posted: Thu Dec 15, 2011 5:51 pm
by teknoratti
thanks for the reply jsmurphy!

so you're saying the command_name is just a reference for nagios and the REAL place the command is executed from is command_line?

My question is, if command_lname is just a reference, It could have been named anything, as long as it was stated in the define service section.

Example:
# Openmanage check via SNMP
define command {
command_name anything_I_want
command_line /usr/lib/nagios/plugins/check_openmanage -H $HOSTADDRESS$ --only temp
}

#Dell TEMP status
define service{
use generic-service
hostgroup_name dell-servers
servicegroups dell-openmanage
service_description Temperature
check_command the_referenced_command_name_from_above

Re: Having trouble with check_openmanage plugin

Posted: Thu Dec 15, 2011 10:23 pm
by jsmurphy
You are 100% correct :)

I also noticed I made a mistake in my second example which I've corrected, you also need to tell it to expect an argument in the command_line definition if you plan to use one ;)