I made an UserParameter Config file
[root@pple8400-60053 zabbix]# cat /etc/zabbix/zabbix_agentd.d/item_pbx.conf
UserParameter=pbx.peer_status[*],/usr/sbin/asterisk -rx 'sip show peer $1' | grep OK | wc -l
UserParameter=pbx.active_channel,/usr/sbin/asterisk -rx 'core show channels' | grep -i 'active channels' | awk '{print $1}'
UserParameter=pbx.active_call,/usr/sbin/asterisk -rx 'core show channels' | grep -i 'active call' | awk '{print $1}'
But in the log file zabbix_agent
#1
5570:20200513:225259.985 Requested [pbx.peer_status]
5570:20200513:225259.985 In zbx_popen() command:'/usr/sbin/asterisk -rx 'sip show peer ' | grep OK | wc -l'
5570:20200513:225259.986 End of zbx_popen():7
5597:20200513:225259.986 zbx_popen(): executing script
5570:20200513:225259.997 In zbx_waitpid()
5570:20200513:225259.997 zbx_waitpid() exited, status:0
5570:20200513:225259.997 End of zbx_waitpid():5597
5570:20200513:225259.997 EXECUTE_STR() command:'/usr/sbin/asterisk -rx 'sip show peer ' | grep OK | wc -l' len:1 cmd_result:'0'
--> It's OK
#2
5569:20200513:230303.892 Requested [pbx.active_channel]
5569:20200513:230303.892 In zbx_popen() command:'/usr/sbin/asterisk -rx 'core show channels' | grep -i 'active channels' | awk '{print $1}''
5569:20200513:230303.893 End of zbx_popen():7
5856:20200513:230303.893 zbx_popen(): executing script
5569:20200513:230303.904 In zbx_waitpid()
5569:20200513:230303.904 zbx_waitpid() exited, status:0
5569:20200513:230303.904 End of zbx_waitpid():5856
5569:20200513:230303.904 EXECUTE_STR() command:'/usr/sbin/asterisk -rx 'core show channels' | grep -i 'active channels' | awk '{print $1}'' len:0 cmd_result:''
in the CLI
[root@pple8400-60053 zabbix_agentd.d]# /usr/sbin/asterisk -rx 'core show channels' | grep -i 'active channels' | awk '{print $1}'
0
It's NOT work. where did i dig ?
#3
5570:20200513:225302.990 Requested [pbx.active_call]
5570:20200513:225302.990 In zbx_popen() command:'/usr/sbin/asterisk -rx 'core show channels' | grep -i 'active call' | awk '{print $1}''
5570:20200513:225302.991 End of zbx_popen():7
5569:20200513:225302.991 zbx_setproctitle() title:'listener #2 [processing request]'
5569:20200513:225302.991 Requested [system.localtime]
5569:20200513:225302.991 Sending back [1589377982]
5569:20200513:225302.991 zbx_setproctitle() title:'listener #2 [waiting for connection]'
5601:20200513:225302.992 zbx_popen(): executing script
5570:20200513:225303.001 In zbx_waitpid()
5570:20200513:225303.001 zbx_waitpid() exited, status:0
5570:20200513:225303.001 End of zbx_waitpid():5601
5570:20200513:225303.001 EXECUTE_STR() command:'/usr/sbin/asterisk -rx 'core show channels' | grep -i 'active call' | awk '{print $1}'' len:0 cmd_result:''
in the CLI
[root@pple8400-60053 zabbix_agentd.d]# /usr/sbin/asterisk -rx 'core show channels' | grep -i 'active call' | awk '{print $1}'
0
It's NOT work!!
what's wrong with my config file ?
[root@pple8400-60053 zabbix]# cat /etc/zabbix/zabbix_agentd.d/item_pbx.conf
UserParameter=pbx.peer_status[*],/usr/sbin/asterisk -rx 'sip show peer $1' | grep OK | wc -l
UserParameter=pbx.active_channel,/usr/sbin/asterisk -rx 'core show channels' | grep -i 'active channels' | awk '{print $1}'
UserParameter=pbx.active_call,/usr/sbin/asterisk -rx 'core show channels' | grep -i 'active call' | awk '{print $1}'
But in the log file zabbix_agent
#1
5570:20200513:225259.985 Requested [pbx.peer_status]
5570:20200513:225259.985 In zbx_popen() command:'/usr/sbin/asterisk -rx 'sip show peer ' | grep OK | wc -l'
5570:20200513:225259.986 End of zbx_popen():7
5597:20200513:225259.986 zbx_popen(): executing script
5570:20200513:225259.997 In zbx_waitpid()
5570:20200513:225259.997 zbx_waitpid() exited, status:0
5570:20200513:225259.997 End of zbx_waitpid():5597
5570:20200513:225259.997 EXECUTE_STR() command:'/usr/sbin/asterisk -rx 'sip show peer ' | grep OK | wc -l' len:1 cmd_result:'0'
--> It's OK
#2
5569:20200513:230303.892 Requested [pbx.active_channel]
5569:20200513:230303.892 In zbx_popen() command:'/usr/sbin/asterisk -rx 'core show channels' | grep -i 'active channels' | awk '{print $1}''
5569:20200513:230303.893 End of zbx_popen():7
5856:20200513:230303.893 zbx_popen(): executing script
5569:20200513:230303.904 In zbx_waitpid()
5569:20200513:230303.904 zbx_waitpid() exited, status:0
5569:20200513:230303.904 End of zbx_waitpid():5856
5569:20200513:230303.904 EXECUTE_STR() command:'/usr/sbin/asterisk -rx 'core show channels' | grep -i 'active channels' | awk '{print $1}'' len:0 cmd_result:''
in the CLI
[root@pple8400-60053 zabbix_agentd.d]# /usr/sbin/asterisk -rx 'core show channels' | grep -i 'active channels' | awk '{print $1}'
0
It's NOT work. where did i dig ?
#3
5570:20200513:225302.990 Requested [pbx.active_call]
5570:20200513:225302.990 In zbx_popen() command:'/usr/sbin/asterisk -rx 'core show channels' | grep -i 'active call' | awk '{print $1}''
5570:20200513:225302.991 End of zbx_popen():7
5569:20200513:225302.991 zbx_setproctitle() title:'listener #2 [processing request]'
5569:20200513:225302.991 Requested [system.localtime]
5569:20200513:225302.991 Sending back [1589377982]
5569:20200513:225302.991 zbx_setproctitle() title:'listener #2 [waiting for connection]'
5601:20200513:225302.992 zbx_popen(): executing script
5570:20200513:225303.001 In zbx_waitpid()
5570:20200513:225303.001 zbx_waitpid() exited, status:0
5570:20200513:225303.001 End of zbx_waitpid():5601
5570:20200513:225303.001 EXECUTE_STR() command:'/usr/sbin/asterisk -rx 'core show channels' | grep -i 'active call' | awk '{print $1}'' len:0 cmd_result:''
in the CLI
[root@pple8400-60053 zabbix_agentd.d]# /usr/sbin/asterisk -rx 'core show channels' | grep -i 'active call' | awk '{print $1}'
0
It's NOT work!!
what's wrong with my config file ?