Best way to approach 300 services/host


#1

Hi,

I have about 300 sensors connected to serial port. They are being monitored by a host. I already wrote plugin for the sensors. It would take argument like this

check_sensor -n <sensor_id>

Now, in my service, I have to find someway to pass the sensor_id to the plugin.
So far, I can think of doing this.

define command{
command_name check_sensor
command_line /usr/local/bin/ruby /users/skanan/w/env_monitor/check_sensor.rb -n $SERVICEDESC$ -v --perfdata
}

define service{
use local-service
host_name localhost
service_description sensor1
check_command check_sensor
}

define service{
use local-service
host_name localhost
service_description sensor2
check_command check_sensor
}

This would distort the fact that they are the same service but running on different sensor. I’m wondering if there is a better way to do this.

Thanks,


#2

Hi

Could you not use…

define command{ command_name check_sensor command_line /usr/local/bin/ruby /users/skanan/w/env_monitor/check_sensor.rb -n $ARG1$ -v --perfdata } define service{ use local-service host_name localhost service_description Sensor A check_command check_sensor!<sensor_id> } ... define service{ use local-service host_name localhost service_description Sensor Z check_command check_sensor!<sensor_id> }

HTH

/S