On 8 February 2011 14:14, johann lafer <[email protected]> wrote: > i am trying to run snmpd with extend and the agent is misinterpreting the > command. > > snmpd.conf: > extend .1.3.6.1.4.1.2021.52 ntpcheck2 > "/usr/bin/ntpq -p | awk 'NR>2 {print $1 \" \" $7}'" > > I am getting the message "No address associated with hostname", which shows > that the pipe is getting lost and ntpq is searching for host awk.
Strictly speaking, it's not that the pipe is getting lost. What's actually happening is that this line is being treated as a command (executed via 'exec'), rather than a pipeline (executed via a shell). So shell-specific syntax (such as pipes and redirection) isn't being interpreted as such here. > I am not allowed to create files on the OS, so creating a batch file is > no option. > > > How do I need to modify the command? Try using "extend-sh" rather than "extend". That *will* run the command via a shell, so should recognise the pipeline. Dave ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
