So I have managed to get teh script I was working on in this thread
to work. However I am now noticing some strangeness. When I paste the result I am one printer short from the list. On closer inspection I noticed that the first printer to be queried in the script was missing. Checked it was not commented out and ran the commands outside of the script to check they worked. Still nothing.
Ran a tail -f on the first text file I redirect to and it seems that it just skips over those two lines, no error or anything. Has anyone come across this before and are there any tricks to try and troubleshoot the issue further. Script below:
echo PQ_CALMLABELS >> printers.txt
snmpget -v 1 -c public 10.168.30.6 SNMPv2-SMI::mib-220.127.116.11.18.104.22.168 &>> printers.txt
echo TR3_1 > printers.txt
snmpget -v 1 -c public 10.168.30.1 SNMPv2-SMI::mib-22.214.171.124.126.96.36.199 &>> printers.txt
P.S. There are some sed commands at the end to remove and format the text but as I mentioned it does not seem to be adding them in to the first text file I create so sed never gets a chance to mess them up!!