Hi,
Configuration file ( /etc/config/mini_snmpd):
config 'mini_snmpd'
option 'community' 'public'
option 'location' 'spain'
option 'contact' 'direccion@correo.es'
option 'disks' '/tmp,/jffs'
option 'interfaces' 'lo,br-lan,eth0.1,eth1' # Max 4 ¿?
Init script (/etc/init.d/mini_snmpd):
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
mini_snmpd_config() {
config_get community $1 community
config_get location $1 location
config_get contact $1 contact
config_get disks $1 disks
config_get interfaces $1 interfaces
}
start() {
config_load mini_snmpd
config_foreach mini_snmpd_config mini_snmpd
/sbin/mini_snmpd -c $community -L $location -C $contact -d $disks -i $interfaces &
}
stop() {
killall mini_snmpd
}
Set executable and link it:
# chmod +x /etc/init.d/mini_snmpd
# cd /etc/rc.d/
# ln -s ../init.d/mini_snmpd S50mini_snmpd
Reboot and try from remote machine (snmpwalk -c public -v 2c 192.168.1.1)
Bye.
PD: Open port 161 on firewall... only for lan.
(Last edited by opotonil on 6 Jul 2009, 20:48)