Quote:
Originally Posted by gtludwig
I'm trying to build a conky config file ... be able to check each server for the top processes, memory and cpu consumption, network interface usage, etc.
...
If so, how can I poll a snmpd running on another server?
|
Hm. I has not dealt with conky but IMHO usually it is much more easier just to poll Linux servers through special scripts rather than trying to grok and to figure out "Simple" management protocol. Frankly, it is simpler when compares with TNM, ha-ha-ha
.
Nevertheless...I'm sure almost anyone can cope with SNMP.
So you just need:
1) to choose (if there is something suitable) or to make youself a script for SNMPd giving correct results depending on requested OID.
2) to tell conky which OID to use. That's the main problem because there are too many OIDs.:-|
Though to give you a common idea about SNMP usage I put here my simple handler for SNMPd:
#!/bin/sh -f
#Give used real memory
PLACE=".1.3.6.1.4.1.2021.4.55"
REQ="$2"
case "$REQ" in
$PLACE.0) RET=$PLACE.0 ;;
*) exit 0 ;;
esac
case "$RET" in
$PLACE.0) echo "integer"; \
# total=`snmpget -v 2c -c public localhost .1.3.6.1.4.1.2021.4.5.0 | cut -d\ -f4`; \
# avail=`snmpget -v 2c -c public localhost .1.3.6.1.4.1.2021.4.6.0 | cut -d\ -f4`; \
#/usr/bin/free | /usr/bin/awk '{if (FNR==2) print $3}';;
/usr/bin/vmstat | /usr/bin/awk '{if (NR==3) print $4}'; exit 0;;
*) echo "string"; echo "ack... $RET $REQ"; exit 0 ;;
esac
I also have in my snmpd.conf this line:
pass .1.3.6.1.4.1.2021.4.55.0 /bin/sh /MY-SWEETHOME/bin/passtest
snmpget/snmpwalk utility allows to check manually what and where. I.e. to verify you can really get what you want if any.
After snmpget results make you happy you can proceed further with conky itself...
I suggest this way.
BTW, there are a lot stuff in /etc/snmp/snmpd.conf
It worths to read and there are good and ready-to-use examples in that config file
but you have to read about SNMP first. Otherwise some things look Greek.
And as always, YMMV.
Cheers!