using awk in check commands
Clint Sulis
clint at misinc.net
Fri Apr 2 21:26:11 CEST 2004
Try backslashing the dollar sign. Hope that works!
On Friday, April 2, 2004, at 11:44 AM, Kevin D. Thompson wrote:
> ?
> 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?
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÓ+ó^µéX¬²'²Þu¼ÿ
>
{±Nëh®&¥°ZÞx¸§»n¶âjZkzǧµç[È6§éQ¡¶âÏÏ
> ë"uéíjwBêéÓ¢^rè"zÏËyªçz÷«ÊØbë¢gîÖ¦z{ZËh³+-
> zf)â²ÚÚ¶*'þm§ÿÿiÛÿ¢ÇgýÊ&ÿöþ'×ôý©e¡ÏâßÏèÉÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> ÿÿÿÿÿÿÿÿÿÿóZ*,þë
®ÉX§X¬´Ö ÿºÇ«³ùb²Ûÿ²«qçè®ÿëa¶ÚlÿÿåËlþÊ.
> Ç¢¸
þw
> þX¬¶ÏåËbú?¨"¢Ïî±êìÿÿÏæ¬z)Üç^5¨"¢ËޮȨúeº§½êìÿþÿÚÓ§
> êh®Ø§©òË.{ÿÿüǬ±¨
³²êi¢»b§~"Zâ²FÞx,z{m£÷^¿ùî
>
>
Clint Sulis
====================
System Administrator
PHP/MySQL Programmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1563 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20040402/ea044bca/attachment.bin>
More information about the Users
mailing list