I am doing indirect checks with NRPE in diferent locations, and those checks/services are usually all the same in each and every location.
so for example for a PC at the location B, I have the following check, in this file the IPofServerB is entered manually, and for each file.
the question, how can I better define a custome variable or enviromental variable, so I can have the IP address of Server B (IPofServerB)
as variable, and then for each different location, B,C,D,.....etc. A unique file for the services defined for all location, and then only define the IP address of the remote server. As well as to pass the variable name either in the hostname or in the alias, so we know from looking at table, which PC and which location has a warning or critical response.
On the other hand the IP of MyPC is always the same defined as static internal IP address. (10.161.164.220)
Code: Select all
define host {
use windows-server
host_name MyPC_$NAMEofB
alias PC_Office_§NAMEofB
address 10.161.164.220
max_check_attempts 5
check_command check_nrpe_ext!IPofSERVERB!'check_ok'
notification_interval 10
check_interval 2
retry_interval 1
max_check_attempts 3
check_period workhours
}
define service {
use generic-service
host_name MyPC_$NAMEofB
service_description CPU_Load
check_command check_nrpe_ext!IPofSERVERB!'check_cpu'!'-a show-all'
}
Any suggestion will be appreciated.
Best Regards,
X.