Nagios Marco

Hi experts,

I am very new to Nagios…managed to install nagios on fedora 9 and successfully setup to monitor a test window pc as per guide…

I came across nagios marco…sound simple…however i dont know where to place all this macro…

based on this example below, if u want to monitor 3 hosts, i would need to define 3 times “define host…” where do i place the “define command…”? inside window.cfg?
define host{
host_name linuxbox
address 192.168.1.2
check_command check_ping

}

define command{
command_name check_ping
command_line /usr/local/nagios/libexec/check_ping -H $HOSTADDRESS$ -w 100.0,90% -c 200.0,60%

Please assist. Thank you.

nagios.sourceforge.net/docs/3_0/quickstart.html

as you defined the first host you’ll need to define the other hosts. If you have the same check on more than one host you can defin the service with more than one host.

[quote=“luca”]http://nagios.sourceforge.net/docs/3_0/quickstart.html

as you defined the first host you’ll need to define the other hosts. If you have the same check on more than one host you can defin the service with more than one host.[/quote]

hi luca,

thank you for your reply however i dont really get your points…would u mind to explain a bit more?Sorry for the inconvenience caused.

if i have 5 hosts to monitor for ping server,i will define 5 hosts under “define hosts”…but where do i place “define command”? how to use macro?

define command{
command_name check_ping
command_line /usr/local/nagios/libexec/check_ping -H $HOSTADDRESS$ -w 100.0,90% -c 200.0,60%

check_ping as a command is already defined in commands.cfg you don’t need to touch it, and you don’t need MACROS to do it.

you define your hosts and you then need to define the service ping…

I think you should try o understand a bit better how nagios works before changing anything else in the configs… try to reread the docs :slight_smile: