aouyar/PyMunin

Error running asteriskstats - TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'

Closed this issue · 7 comments

Hi there.

I've started using PyMunin last thursday, everything is working just fine, except for asteriskstat, which returns:

munin-run asteriskstats --pidebug

Traceback (most recent call last):
File "/etc/munin/plugins/asteriskstats", line 241, in
sys.exit(muninMain(MuninAsteriskPlugin))
File "/usr/share/munin/plugins/pymunin/init.py", line 659, in muninMain
ret = plugin.run()
File "/usr/share/munin/plugins/pymunin/init.py", line 461, in run
ret = self.fetch()
File "/usr/share/munin/plugins/pymunin/init.py", line 439, in fetch
self.retrieveVals()
File "/etc/munin/plugins/asteriskstats", line 211, in retrieveVals
sipstats.get(field) + iax2stats.get(field))
TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'

I am using Asterisk 1.6.2.20, and my AMI account has the following rights:

[ippbx]
secret = asteriks
read = system,call,log,verbose,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
write = system,call,log,verbose,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate

asterisk -rx "sip show channels"
Peer User/ANR Call ID Format Hold Last Message Expiry
186.211.128.59 554784046006 4ed58a257b69f5a 0x100 (g729) No Tx: ACK
177.40.11.169 7010 2272116541@192_ 0x100 (g729) No Rx: ACK
2 active SIP dialogs

asterisk -rx "iax2 show channels"
Channel Peer Username ID (Lo/Rem) Seq (Tx/Rx) Lag Jitter JitBuf Format FirstMsg LastMsg
0 active IAX channels

Any help is welcome.

Thanks in advance,

Hi,

Just to make sure it is not a permissions problem could you try the
following:

[ippbx]
secret = asteriks
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = all
write = all

Thanks

On Mon, Aug 29, 2011 at 11:53 AM, alexandrekeller <
reply@reply.github.com>wrote:

Hi there.

I've started using PyMunin last thursday, everything is working just fine,
except for asteriskstat, which returns:

munin-run asteriskstats --pidebug

Traceback (most recent call last):
File "/etc/munin/plugins/asteriskstats", line 241, in
sys.exit(muninMain(MuninAsteriskPlugin))
File "/usr/share/munin/plugins/pymunin/init.py", line 659, in
muninMain
ret = plugin.run()
File "/usr/share/munin/plugins/pymunin/init.py", line 461, in run
ret = self.fetch()
File "/usr/share/munin/plugins/pymunin/init.py", line 439, in fetch
self.retrieveVals()
File "/etc/munin/plugins/asteriskstats", line 211, in retrieveVals
sipstats.get(field) + iax2stats.get(field))
TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'

I am using Asterisk 1.6.2.20, and my AMI account has the following rights:

[ippbx]
secret = asteriks
read =
system,call,log,verbose,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
write =
system,call,log,verbose,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate

asterisk -rx "sip show channels"
Peer User/ANR Call ID Format Hold
Last Message Expiry
186.211.128.59 554784046006 4ed58a257b69f5a 0x100 (g729) No
Tx: ACK
177.40.11.169 7010 2272116541@192_ 0x100 (g729) No
Rx: ACK
2 active SIP dialogs

asterisk -rx "iax2 show channels"
Channel Peer Username ID (Lo/Rem) Seq (Tx/Rx)
Lag Jitter JitBuf Format FirstMsg LastMsg
0 active IAX channels

Any help is welcome.

Thanks in advance,

Reply to this email directly or view it on GitHub:
#4

Hi.

I've done it, and:.

vm-ipbx02debian6*CLI> !munin-run asteriskstats --pidebug
Traceback (most recent call last):
File "/etc/munin/plugins/asteriskstats", line 241, in
sys.exit(muninMain(MuninAsteriskPlugin))
File "/usr/share/munin/plugins/pymunin/init.py", line 659, in muninMain
ret = plugin.run()
File "/usr/share/munin/plugins/pymunin/init.py", line 461, in run
ret = self.fetch()
File "/usr/share/munin/plugins/pymunin/init.py", line 439, in fetch
self.retrieveVals()
File "/etc/munin/plugins/asteriskstats", line 211, in retrieveVals
sipstats.get(field) + iax2stats.get(field))
TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'
[Aug 29 14:05:30] == Manager 'ippbx' logged on from 127.0.0.1
[Aug 29 14:05:30] == Manager 'ippbx' logged off from 127.0.0.1

I cannot figure out what might be causing the issue just by looking at the code. Can you give me remote access? A shared screen session or maybe VNC?

It's working fine on Ubuntu 11.04, Asterisk 1.6.2.9 with Python 2.7.

I am using Debian Squeeze, Asterisk 1.6.2.20 and Python 2.6

My bad. I've changed the original code and It caused the problem.

thanks aouyar, for your help.

Closing issue, because the error was caused by a change made by the user to graph more codecs. I will se if I can add a configurable codec list to the plugin.