Diese Konfiguration soll zukünftig Wlan Accesspoints und sonstige SNMP Geräte überwachen.
Man braucht „spezielle“ Versionen von OpenWRT Paketen:
opkg update && opkg install lighttpd lighttpd-mod-cgi nagios nagios-plugins php5-cgi
cgi.assign = ( ".php" => "/usr/bin/php-cgi" ) $HTTP["url"] =~ "^/nagios/cgi-bin" { cgi.assign = ( "" => "" ) }
doc_root = /usr/share
#!/bin/sh /etc/rc.common # Copyright (C) 2006 OpenWrt.org START=50 BIN=nagios DEFAULT=/etc/default/$BIN PID_F=$RUN_D/$BIN.pid start() { [ -f $DEFAULT ] && . $DEFAULT $BIN $TEST && $BIN $OPTIONS } stop() { [ -f $PID_F ] && kill $(cat $PID_F) }
CFG="/etc/nagios/nagios.cfg" OPTIONS="-d $CFG" TEST="-v $CFG"
cd /etc/nagios ln -s ../init.d/nagios S51nagios
mkdir -p /var/spool/checkresults mkdir /var/rw
$USER1$=/usr/libexec/nagios/
$HTTP["url"] =~ "nagios" { auth.backend = "htpasswd" auth.backend.htpasswd.userfile = "/etc/nagios/passwd" auth.require = ( "" => ( "method" => "basic", "realm" => "nagios", "require" => "user=nagiosadmin" ) ) setenv.add-environment = ( "REMOTE_USER" => "user" ) }
opkg install mini-httpd-htpasswd
htpasswd -c /etc/nagios/passwd nagiosadmin
opkg install lighttpd-mod-auth
Gibt Sachen aus wie z.B.:
Cannot find module....
Lösung:
mibdirs /usr/lib/snmp
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,getnext,set,status,test,trap,walk} $(1)/usr/bin/
--with-nslookup-command="/usr/bin/nslookup" \ --with-snmpget-command="/usr/bin/snmpget" \ --with-snmpgetnext-command="/usr/bin/snmpgetnext"