All,

I'm at a loss about why this  snmpget in a simple script that loops over
all the device name is not working .
I changed csh to ksh
I checked and I know the snmpget is installed.


-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Stuart Jansen
Sent: Monday, June 01, 2009 8:58 AM
To: BYU Unix Users Group
Subject: Re: [uug] SNMP

On Mon, 2009-06-01 at 08:41 -0700, Lemseffer. Tahar (MSA) wrote:
> Morning All,
> I just want to thank Mr. Adam Augustine his help.
> Here is what I did , but did not work.
> #!/bin/csh
> $FDDI_MM_LIST='ypcat hosts | grep cnr | grep f |sort |awk "{print $2}'
> For CONCENTRATOR in $FDDI_MM_LIST
> Do 
> Echo""
> ERRORCOUNT='snmpget -v1 2c -c public $concentrator 1.3.6.1.2.1.11.4 |
> awk " "{print $4}'
> Echo "$CONCENTRATOR= $ERRORCOUNT"
> Done
> 
> The result said snmpget: not found
> 
> AM I doing something wrong.

Your first problem is that you're using csh. Friends don't let friends
use csh.

Your second problem is that your csh script is not valid csh. If this is
your first experience writing shell scripts, you should write small test
scripts to make sure you understand how to do things like set variable
or capture the output of commands.

Your third problem is most likely that snmpget is not installed. Have
you already tested each step of the script by hand to make sure it does
what you expect?

-- 
"XML is like violence: if it doesn't solve your problem, you aren't
using enough of it." - Chris Maden

--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG.

___________________________________________________________________
List Info (unsubscribe here):
http://uug.byu.edu/mailman/listinfo/uug-list
____________________________________________________________________________
EMAIL DISCLAIMER:
This email and any attachments thereto may contain private, confidential, and
privileged material for the sole use of the intended recipient. Any review,
copying, or distribution of this email (or any attachments thereto) by other
than the intended recipient is strictly prohibited.

If you are not the intended recipient, please contact the sender immediately
and permanently delete the original and any copies of this email and any
attachments thereto.
_____________________________________________________________________________

--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list

Reply via email to