Thank you Robert, The code will output the list of my hosts file. I want to be able to keep track on all my devices using snmp, check if there is an intrusion also, Thanks
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Robert Citek Sent: Monday, October 26, 2009 9:57 AM To: General Linux/UNIX discussion and help,civil and on-topic Subject: Re: [PLUG] shell scripting Try running this variation of the script: LIST = 'ypcat hosts|| sort | awk '{print $2}'' for Devices in $LIST ; do echo $Devices done > output.txt Post the contents of output.txt I suspect the error is in using single quotes instead of backtics and possibly using an OR (||) instead of a pipe. If you are using bash, I would recommend using $() instead of backtics. Regards, - Robert On Wed, Oct 21, 2009 at 5:00 PM, Lemseffer. Tahar (MSA) <[email protected]> wrote: > here is what i did : > > LIST = 'ypcat hosts|| sort | awk '{print $2}'' > for Devices in $LIST > do > Errorcount=`snmpget -v1 -c privator $Devices snmpInBadCommunityNames.O > |awk '{print $4}' ` > if [ Errorcount > 0 ]; then > Devices=$Errorcount > echo $Devices > # line added > echo "$sysdate $Devices" >> /tmp/hosthistory.txt > > fi > done > > but the answer is wrong cause i'm getting an errorcount. > > Thank you All > > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of [email protected] > Sent: Wednesday, October 21, 2009 12:30 PM > To: [email protected] > Subject: Re: [PLUG] PLUG AT talk this Thursday? > > Michael Dexter wrote: > >> > Michael> What are people's thoughts about a NetBSD Xen walk through > on >> > Michael> Thursday from 7PM - 9PM at Club 915 at 915 SW 2nd? >> > ... >> >> Would anyone want THIS topic THIS Thursday? > > I would. Is this still happening? > > Jeff W > _______________________________________________ > PLUG mailing list > [email protected] > http://lists.pdxlinux.org/mailman/listinfo/plug > ____________________________________________________________________________ > 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. > _____________________________________________________________________________ > > _______________________________________________ > PLUG mailing list > [email protected] > http://lists.pdxlinux.org/mailman/listinfo/plug > _______________________________________________ PLUG mailing list [email protected] http://lists.pdxlinux.org/mailman/listinfo/plug _______________________________________________ PLUG mailing list [email protected] http://lists.pdxlinux.org/mailman/listinfo/plug
