chad
08-12-2004 08:34:18
I having difficulty creating a little script that gets the page count OID from some HP printers. Here's the script:
It seems the $printer var is not being referenced correctly in the command substitution part of count$=(snmpget.... ). Can somebody help out a rookie shell scripter?
Oh, here's a copy of the error I get when running the script:
#!/bin/bash
logdir=/var/log/page_counts
date=`date +%Y%m%d\ %T`
printers_list="hp4-2c hp4-3c hp4-4c"
for printer in $printers_list
do
count=$(snmpget -O qv -c public -v 1 $printer 1.1.3.6.1.2.1.43.10.2.1.4.1.1)
#echo $date $count >> $logdir/$printer
echo $date $count
done
It seems the $printer var is not being referenced correctly in the command substitution part of count$=(snmpget.... ). Can somebody help out a rookie shell scripter?
Oh, here's a copy of the error I get when running the script:
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.1.3.6.1.2.1.43.10.2.1.4.1.1