thanks all for your help, I really appreciate.<br><br>now it's working <br><br>My problem was due to <br>Nov 27 12:56:28 trixbox1 snmpd[5743]: /etc/snmp/snmpd.conf: line 61: Error: example config COMMUNITY not properly configured<br>
Nov 27 12:56:28 trixbox1 snmpd[5743]: /etc/snmp/snmpd.conf: line 62: Error: example config NETWORK not properly configured<br><br>with the link michal gave to me I succeed in getting asterisk working<br><br>regards<br><br>
Mickael<br><br><br><div class="gmail_quote">2009/11/27 Lee Archer <span dir="ltr"><<a href="mailto:Lee.Archer@thebigword.com">Lee.Archer@thebigword.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-GB">
<div>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">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.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Copy asterisk-mib.txt and digium-mib.txt from <asterisk_source>/doc
to /usr/share/snmp/mibs/</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">mkdir /var/agentx</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">touch /var/agentx/master</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">My /etc/asterisk/res_snmp.conf</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">;</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">; Configuration file for res_snmp</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">;</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">[general]</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">; We run as a subagent per default -- to run as a full agent</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">; we must run as root (to be able to bind to port 161)</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">;subagent = yes</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">; SNMP must be explicitly enabled to be active</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">enabled = yes</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">My snmp.conf</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">rwcommunity private 127.0.0.1</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">rocommunity public</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">disk /</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">master agentx</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">agentXperms 0660 0550 root root</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">restart snmp and the /var/agentx/master should look like srw-rw----
1 root root 0 Nov 25 11:31 /var/agentx/master</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">restart asterisk manually and you see a net-snmp connect.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">export MIBS=+ASTERISK-MIB</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">You should be able to to do a snmpwalk –v 2c –c public
localhost asterisk</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Regards</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Lee</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>
[mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>] <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</span></p>
</div><div><div></div><div class="h5">
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="margin-bottom: 12pt;">Michal<br>
<br>
please wait I found some issues in my con file</p>
<div>
<p class="MsoNormal">2009/11/27 mickael ropars <<a href="mailto:mropars@gmail.com" target="_blank">mropars@gmail.com</a>></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</p>
<div>
<p class="MsoNormal" style="margin-bottom: 12pt;"><br>
#<br>
<br>
master agentx<br>
agentXperms 0660 0550 nobody asterisk<br>
SNMPD_FLAGS="${SNMPD_FLAGS} -x /var/agentx/master"<br>
mibs +ASTERISK-MIB</p>
</div>
<p class="MsoNormal">###############################################################################<br>
# Further Information</p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom: 12pt;"><br>
<br>
<br>
<br>
</p>
<div>
<p class="MsoNormal">2009/11/27 michal kalinowski <<a href="mailto:michal.kalinowski@interia.pl" target="_blank">michal.kalinowski@interia.pl</a>></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ł:</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></p>
</div>
</div>
</div>
<p class="MsoNormal"> </p>
</div>
</div>
</div>
<p class="MsoNormal"> </p>
</div></div></div>
</div>
<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></blockquote></div><br>