Multiple Usernames and Passwords in Service Checks
Posted: Tue May 06, 2014 11:06 am
I need to use multiple user names and passwords in order to get data from some of our servers. The resource.cfg file has $USERx$ etc but if I use that then I'll need to have an equal number of commands.cfg set up with those. That would make the commands.cfg file extremely large and a pain to update. How do I use multiple usernames and passwords in the checks?
Below are examples of what is already in place.
resource.cfg
$USER2$=username
$USER4$=password
commands.cfg
# check temperature
define command{
command_name check_esx_temperature
command_line $USER1$/check_vmware.pl -H $HOSTADDRESS$ -u $USER2$ -p $USER4$ -l runtime -s temperature -w $ARG1$ -c $ARG2$
}
hosts.cfg
define host{
use linux_host
host_name esxi_host
alias esxi_host
address 192.168.7.7
contact_groups admins
hostgroups vmware-esxi
}
What do I need to add to allow multiple user names and passwords to use the same commands?
Thank you for your time.
Below are examples of what is already in place.
resource.cfg
$USER2$=username
$USER4$=password
commands.cfg
# check temperature
define command{
command_name check_esx_temperature
command_line $USER1$/check_vmware.pl -H $HOSTADDRESS$ -u $USER2$ -p $USER4$ -l runtime -s temperature -w $ARG1$ -c $ARG2$
}
hosts.cfg
define host{
use linux_host
host_name esxi_host
alias esxi_host
address 192.168.7.7
contact_groups admins
hostgroups vmware-esxi
}
What do I need to add to allow multiple user names and passwords to use the same commands?
Thank you for your time.