<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-2">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-GB link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I use CentOS, and it works fairly well. But I had to piece
together info from several places. I’ve tried it several different wants
and this way worked, as long as asterisk is run as root.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Copy asterisk-mib.txt and digium-mib.txt from <asterisk_source>/doc
to /usr/share/snmp/mibs/<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>mkdir /var/agentx<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>touch /var/agentx/master<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>My /etc/asterisk/res_snmp.conf<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>;<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>; Configuration file for res_snmp<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>;<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>[general]<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>; We run as a subagent per default -- to run as a full agent<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>; we must run as root (to be able to bind to port 161)<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>;subagent = yes<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>; SNMP must be explicitly enabled to be active<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>enabled = yes<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>My snmp.conf<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>rwcommunity private 127.0.0.1<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>rocommunity public<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>disk /<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>master agentx<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>agentXperms 0660 0550 root root<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>restart snmp and the /var/agentx/master should look like srw-rw----
1 root root 0 Nov 25 11:31 /var/agentx/master<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>restart asterisk manually and you see a net-snmp connect.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>export MIBS=+ASTERISK-MIB<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>You should be able to to do a snmpwalk –v 2c –c public
localhost asterisk<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Regards<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Lee<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <b>On Behalf Of </b>mickael
ropars<br>
<b>Sent:</b> 27 November 2009 11:58<br>
<b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion<br>
<b>Subject:</b> Re: [asterisk-users] ASTERISK and SNMP<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>Michal<br>
<br>
please wait I found some issues in my con file<o:p></o:p></p>
<div>
<p class=MsoNormal>2009/11/27 mickael ropars <<a
href="mailto:mropars@gmail.com" target="_blank">mropars@gmail.com</a>><o:p></o:p></p>
<p class=MsoNormal>I am running on Trixbox so my OS is Cent0S 5.4 and the
Asterisk version is 1.4.22-4<br>
<br>
on asterisk side Snmp module is running:<br>
<br>
> module load res_snmp.so<br>
== Parsing '/etc/asterisk/res_snmp.conf': Found<br>
Loading [Sub]Agent Module<br>
Loaded res_snmp.so => (SNMP [Sub]Agent for Asterisk)<br>
<br>
see below my snmpd.conf file (I remove commented line for an easy reading)<br>
<br>
regards<br>
<br>
Mickael<br>
<br>
<br>
<br>
<br>
###############################################################################<br>
# Access Control<br>
###############################################################################<br>
<br>
####<br>
# First, map the community name (COMMUNITY) into a security name<br>
# (local and mynetwork, depending on where the request is coming<br>
# from):<br>
<br>
# <a href="http://sec.name" target="_blank">sec.name</a>
source community<br>
com2sec local
localhost COMMUNITY<br>
com2sec mynetwork NETWORK/24 COMMUNITY<br>
<br>
<br>
rwcommunity local<br>
rocommunity local<br>
<br>
####<br>
# Second, map the security names into group names:<br>
<br>
#
sec.model <a href="http://sec.name" target="_blank">sec.name</a><br>
group MyRWGroup v1 local<br>
group MyRWGroup v2c local<br>
group MyRWGroup usm local<br>
group MyROGroup v1 mynetwork<br>
group MyROGroup v2c mynetwork<br>
group MyROGroup usm mynetwork<br>
<br>
####<br>
# Third, create a view for us to let the groups have rights to:<br>
<br>
# incl/excl
subtree
mask<br>
view all included
.1
80<br>
<br>
####<br>
# Finally, grant the 2 groups access to the 1 view with different<br>
# write permissions:<br>
<br>
#
context sec.model sec.level match read write notif<br>
access MyROGroup ""
any noauth exact
all none none<br>
access MyRWGroup ""
any noauth exact
all all none<br>
<br>
<br>
###############################################################################<br>
# System contact information<br>
#<br>
<br>
syslocation Right here, right now.<br>
syscontact Me <<a href="mailto:me@somewhere.org" target="_blank">me@somewhere.org</a>><br>
<br>
<br>
<br>
###############################################################################<br>
# Process checks.<br>
#<br>
# Make sure mountd is running<br>
proc mountd<br>
<br>
# Make sure there are no more than 4 ntalkds running, but 0 is ok too.<br>
proc ntalkd 4<br>
<br>
# Make sure at least one sendmail, but less than or equal to 10 are
running.<br>
proc sendmail 10 1<br>
<br>
<br>
###############################################################################<br>
# Executables/scripts<br>
#<br>
<br>
# a simple hello world<br>
exec echotest /bin/echo hello world<br>
<br>
###############################################################################<br>
# disk checks<br>
#<br>
<br>
disk / 10000<br>
<br>
<br>
###############################################################################<br>
# load average checks<br>
#<br>
<br>
# Check for loads:<br>
load 12 14 14<br>
<br>
<br>
###############################################################################<br>
# Extensible sections.<br>
#<br>
<br>
<br>
<br>
###############################################################################<br>
# Pass through control.<br>
#<br>
<br>
###############################################################################<br>
# Subagent control<o:p></o:p></p>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
#<br>
<br>
master agentx<br>
agentXperms 0660 0550 nobody asterisk<br>
SNMPD_FLAGS="${SNMPD_FLAGS} -x /var/agentx/master"<br>
mibs +ASTERISK-MIB<o:p></o:p></p>
</div>
<p class=MsoNormal>###############################################################################<br>
# Further Information<o:p></o:p></p>
<div>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
<br>
<br>
<br>
<o:p></o:p></p>
<div>
<p class=MsoNormal>2009/11/27 michal kalinowski <<a
href="mailto:michal.kalinowski@interia.pl" target="_blank">michal.kalinowski@interia.pl</a>><o:p></o:p></p>
<p class=MsoNormal>What operating system do You have ? What asterisk version
You compile ?<br>
After install net-snmp do You recompile asterisk with res_snmp module ?<br>
<br>
I'm used instruction from here<br>
<a href="http://voxilla.com/2009/02/03/configuring-asterisk-snmp-support-1131"
target="_blank">http://voxilla.com/2009/02/03/configuring-asterisk-snmp-support-1131</a><br>
and everything work correctly.<br>
<br>
BR,<br>
Michał<br>
W dniu 27 listopada 2009 11:18 użytkownik mickael ropars<br>
<<a href="mailto:mropars@gmail.com" target="_blank">mropars@gmail.com</a>>
napisał:<o:p></o:p></p>
<div>
<div>
<p class=MsoNormal>> Hi Michal,<br>
><br>
> thanks a lot for you quick answer I appreciate.<br>
><br>
> I run your commands and I have the following answer<br>
><br>
> [localhost snmp]# snmpwalk -c local -v 1 localhost asterisk<br>
> no answer<br>
><br>
> [localhost snmp]# snmpwalk -c local -v 2c localhost asterisk<br>
> ASTERISK-MIB::asterisk = No Such Object available on this agent at this
OID<br>
><br>
><br>
> since I don't know well snmp what's going wrong ?<br>
><br>
> regards<br>
><br>
> Mickael<br>
><br>
><br>
><br>
> 2009/11/27 michal kalinowski <<a
href="mailto:michal.kalinowski@interia.pl" target="_blank">michal.kalinowski@interia.pl</a>><br>
>><br>
>> Hello Mickael<br>
>><br>
>> Here You have the snmpd.conf file<br>
>><br>
>> cat /etc/snmp/snmpd.conf<br>
>> rocommunity your_community<br>
>> master agentx<br>
>> agentXperms 0660 0550 nobody asterisk<br>
>> SNMPD_FLAGS="${SNMPD_FLAGS} -x /var/agentx/master"<br>
>> mibs +ASTERISK-MIB<br>
>><br>
>> and also you need create file /etc/snmp/snmp.conf with following entry<br>
>> "mibs +ASTERISK-MIB"<br>
>><br>
>> cat /etc/snmp/snmp.conf<br>
>> mibs +ASTERISK-MIB<br>
>><br>
>> Next use command "snmpwalk -c your_community -v 1 localhost
asterisk"<br>
>> to check is everything correct.<br>
>><br>
>><br>
>><br>
>> Michał<br>
>><br>
>> 2009/11/27 mickael ropars <<a href="mailto:mropars@gmail.com"
target="_blank">mropars@gmail.com</a>>:<br>
>> > Hi all,<br>
>> ><br>
>> > I am currently not able to configure SNMP for asterisk, but I am
not<br>
>> > able to<br>
>> > acess to the asterisk MIB (the asterisk MIB is in
/usr/share/snmp/mibs/)<br>
>> ><br>
>> ><br>
>> > Does somebody has an example of smnpd.conf file wich is working ?<br>
>> ><br>
>> > regards<br>
>> ><br>
>> > Mickael<br>
>> ><br>
>> > _______________________________________________<br>
>> > -- Bandwidth and Colocation Provided by <a
href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a>
--<br>
>> ><br>
>> > asterisk-users mailing list<br>
>> > To UNSUBSCRIBE or update options visit:<br>
>> > <a
href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
>> ><br>
>><br>
>> _______________________________________________<br>
>> -- Bandwidth and Colocation Provided by <a
href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a>
--<br>
>><br>
>> asterisk-users mailing list<br>
>> To UNSUBSCRIBE or update options visit:<br>
>> <a
href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
><br>
><br>
> _______________________________________________<br>
> -- Bandwidth and Colocation Provided by <a
href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a>
--<br>
><br>
> asterisk-users mailing list<br>
> To UNSUBSCRIBE or update options visit:<br>
> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users"
target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
><br>
<br>
_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com"
target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users"
target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><o:p></o:p></p>
</div>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>