using awk in check commands
Kevin D. Thompson
Kevin.Thompson at duluth.k12.mn.us
Fri Apr 2 20:44:36 CEST 2004
?
Hi all,
I want to make a simple check command that will return the serial number of my Cisco routers.
I run this command from the command line
/usr/local/bin/snmpget -v 2c -c *snmpremoved central-2621-1
1.3.6.1.4.1.9.3.6.3.0 | awk -F'"' '{print $2}'
and I get the appropriate response. So then I added that to my
checkcommands.cfg file, as the following entry
define command{
command_name get_router_serial_number
command_line /usr/local/bin/snmpget -v 2c -c *snmpremoved $HOSTADDRESS$
1.3.6.1.4.1.9.3.6.3.0 | awk -F'"' '{print $2}'
}
when I run Nagios, I keep getting errors from awk,
awk: cmd. line:2: {print $2}$
awk: cmd. line:2: ^ unexpected newline
Any thoughts on why this works from the command line, but not in the
check command I made?
N¬HS^µéX¬²'²Þu¼ÂâìSºÚ+©l·.)îÆÛ¢¸Þ±éíyÖò
©âzThm¸§°úÞ²'^Ö§t!¡ñ:(µç!h'¬-æ«ëÞ¯+ax®ºwZéíj[-¢Ì¬µévh§Ëkjبm§ÿÚvÊ,vw(öÝxïF¥"w~·ò
More information about the Users
mailing list