problem using macros
Posted: Thu Jul 05, 2012 1:11 pm
Nagios Core 3.4.1
Platform Ubuntu 10.04
It seems to me that the standard macro definitions are missing from my install. I cannot find anything on how to check the available macros (resources.cfg?) Reading the http://nagios.sourceforge.net/docs/3_0/macrolist.html
$HOSTADDRESS$ is listed as a standard macro, so I do not understand why I'm getting this error:
Processing object config file '/usr/local/nagios/etc/switches/heclab_wplab_switches.cfg'...
Error: Invalid command object directive '-H'.
Error: Could not add object property in file '/usr/local/nagios/etc/switches/heclab_wplab_switches.cfg' on line 33. (Marked below in blue)
Error processing object config files!
#
# Begin HostGroup 'Switches' (Cisco)
#
define hostgroup {
hostgroup_name Switches
alias Cisco
members oak.hec.lab.stk.samuelmerritt.edu
}
# oak.hec.lab.stk.samuelmerritt.edu - {--osmatch--}
define host {
host_name oak.hec.lab.stk.samuelmerritt.edu
alias oak.hec.lab.stk
address 10.24.167.21
check_command check-host-alive
max_check_attempts 3
checks_enabled 1
failure_prediction_enabled 1
retain_status_information 1
retain_nonstatus_information 1
notification_interval 5
contact_groups admins
}
# Cisco CatOS switch (will work for 5500 and many others), full set of possible options is given:
define command {
command_name check_snmp_netint_catos
command_line check_snmp_netint.pl -2 -f -C "$USER5$" -X (my community string)
-H $HOSTADDRESS$ -N 1.3.6.1.2.1.31.1.1.1.1 --cisco=show_portnames --stp
-n $ARG1$ -w $ARG2$ -c $ARG3$ -d 200 -e -q -k -y -M -B -mm
-P $SERVICEPERFDATA$ -T $LASTSERVICECHECK$
}
define service{
use std-switch-service
servicegroups snmp,netstatistics
hostgroup_name cs2960
service_description GigabitEthernet0/1
check_command check_snmp_network_interface_cisco2960!"GigabitEthernet0/1$"!0,0,0,0,0,0!0,0,0,0,0,0
}
any help or insight would be appreciated
Platform Ubuntu 10.04
It seems to me that the standard macro definitions are missing from my install. I cannot find anything on how to check the available macros (resources.cfg?) Reading the http://nagios.sourceforge.net/docs/3_0/macrolist.html
$HOSTADDRESS$ is listed as a standard macro, so I do not understand why I'm getting this error:
Processing object config file '/usr/local/nagios/etc/switches/heclab_wplab_switches.cfg'...
Error: Invalid command object directive '-H'.
Error: Could not add object property in file '/usr/local/nagios/etc/switches/heclab_wplab_switches.cfg' on line 33. (Marked below in blue)
Error processing object config files!
#
# Begin HostGroup 'Switches' (Cisco)
#
define hostgroup {
hostgroup_name Switches
alias Cisco
members oak.hec.lab.stk.samuelmerritt.edu
}
# oak.hec.lab.stk.samuelmerritt.edu - {--osmatch--}
define host {
host_name oak.hec.lab.stk.samuelmerritt.edu
alias oak.hec.lab.stk
address 10.24.167.21
check_command check-host-alive
max_check_attempts 3
checks_enabled 1
failure_prediction_enabled 1
retain_status_information 1
retain_nonstatus_information 1
notification_interval 5
contact_groups admins
}
# Cisco CatOS switch (will work for 5500 and many others), full set of possible options is given:
define command {
command_name check_snmp_netint_catos
command_line check_snmp_netint.pl -2 -f -C "$USER5$" -X (my community string)
-H $HOSTADDRESS$ -N 1.3.6.1.2.1.31.1.1.1.1 --cisco=show_portnames --stp
-n $ARG1$ -w $ARG2$ -c $ARG3$ -d 200 -e -q -k -y -M -B -mm
-P $SERVICEPERFDATA$ -T $LASTSERVICECHECK$
}
define service{
use std-switch-service
servicegroups snmp,netstatistics
hostgroup_name cs2960
service_description GigabitEthernet0/1
check_command check_snmp_network_interface_cisco2960!"GigabitEthernet0/1$"!0,0,0,0,0,0!0,0,0,0,0,0
}
any help or insight would be appreciated