Asterisk snmp: Unterschied zwischen den Versionen
Aus metasec wiki
Admin (Diskussion | Beiträge) |
Admin (Diskussion | Beiträge) |
||
Zeile 23: | Zeile 23: | ||
# snmptrapd options (use syslog). | # snmptrapd options (use syslog). | ||
TRAPDOPTS='-a -Lsd -p /var/run/snmptrapd.pid' | TRAPDOPTS='-a -Lsd -p /var/run/snmptrapd.pid' | ||
− | |||
</pre> | </pre> | ||
/etc/snmp/snmpd.conf | /etc/snmp/snmpd.conf | ||
+ | |||
<pre> | <pre> | ||
rocommunity public | rocommunity public | ||
Zeile 43: | Zeile 43: | ||
rwuser asteriskUser priv | rwuser asteriskUser priv | ||
createUser asteriskUser SHA hallo123 DES | createUser asteriskUser SHA hallo123 DES | ||
− | |||
</pre> | </pre> | ||
Zeile 49: | Zeile 48: | ||
/etc/asterisk/res_snmp.conf | /etc/asterisk/res_snmp.conf | ||
<pre> | <pre> | ||
− | |||
[general] | [general] | ||
subagent = yes | subagent = yes | ||
enabled = yes | enabled = yes | ||
− | |||
</pre> | </pre> | ||
Version vom 11. März 2010, 19:57 Uhr
Installieren
apt-get install snmp snmpd
/etc/default/snmpd
# This file controls the activity of snmpd and snmptrapd # MIB directories. /usr/share/snmp/mibs is the default, but # including it here avoids some strange problems. export MIBDIRS=/usr/share/snmp/mibs # snmpd control (yes means start daemon). SNMPDRUN=yes # snmpd options (use syslog, close stdin/out/err). SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid ' # snmptrapd control (yes means start daemon). As of net-snmp version # 5.0, master agentx support must be enabled in snmpd before snmptrapd # can be run. See snmpd.conf(5) for how to do this. TRAPDRUN=yes # snmptrapd options (use syslog). TRAPDOPTS='-a -Lsd -p /var/run/snmptrapd.pid'
/etc/snmp/snmpd.conf
rocommunity public master agentx agentXSocket /var/run/agentx agentXPerms 0660 0550 root root com2sec local 192.168.199.253 public com2sec mynetwork0 192.168.199.0/24 public group MyROGroup any local group MyROGroup any mynetwork0 view all included .1 access MyROGroup "" any noauth 0 all none none # Asterisk user rwuser asteriskUser priv createUser asteriskUser SHA hallo123 DES
/etc/asterisk/res_snmp.conf
[general] subagent = yes enabled = yes
asterisk neu starten!!! vorsicht nicht im laufenden betrieb
/etc/init.d/asterisk restart
testen
snmpwalk -v 2c -c public localhost asterisk
oder
snmpwalk -v 3 -u asteriskUser -n "" -l authPriv -a SHA -A hallo123 -x DES -X hallo123 localhost asterisk
wenn was zurückkommt dann läuft alles :->