Default port for zabbix falls into the range of 10000-20000 which are used by asterisk. So I've been forced to find a different port to setup zabbix on. We've already got the zabbix server up and running and are monitoring a number of other hosts using the default ports of 10050 and 10051.
My understanding is that to monitor our asterisk server using the zabbix agent I'll need 2 ports so I've considered using 20006 and 20007 as they're unusued on our system and unassigned by IANA which should make it less likely to have a conflict. I've changed the listen port number in
the zabbix_agentd.conf to 20006 and edited /etc/services to
My config file is as follows, but I'll be leaving out the commented sections to keep things concise.
If I run service zabbix_agentd start the agent starts up and I run netstat -l which outputs:
so it looks like the zabbix_agent is running and listening.
But when I try
produces
and
produces
So as you can see I've got a problem connecting to the host to retrieve that information, but I'm not really sure where/what is causing that issue. Someone else is charge of the firewall, so I'll be having them take a look and see if that's what's causing the problem, but if you see something that I may have overlooked that I need to change to get this working please let me know.
I'm also working towards some certifications and have been reading recently that ports don't necessarily need to be the same on both ends, and my understanding is that I could use port 20007 on my asterisk server to send to port 10051 on the zabbix server. Is that the case or do I need to change something else in order to get this working?
My understanding is that to monitor our asterisk server using the zabbix agent I'll need 2 ports so I've considered using 20006 and 20007 as they're unusued on our system and unassigned by IANA which should make it less likely to have a conflict. I've changed the listen port number in
the zabbix_agentd.conf to 20006 and edited /etc/services to
Code:
zabbix_agent 20006/tcp zabbix_trap 20007/tcp
Code:
LogFile=/tmp/zabbix_agentd.log LogFileSize=1 Server=xxx.xxx.x.xx Hostname=xxxxxxx.xxxxxxxxxx.xxx ListenPort=20006 ListenIP=xx.xx.xx.xxx
Code:
Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 *:zabbix_agent *:* LISTEN
But when I try
Code:
telnet xx.xx.xx.xxx 20006
Code:
telnet: connect to address xx.xx.xx.xxx: Connection refused
Code:
zabbix_get -s xx.xx.xx.xxx -p 20006 -k agent.ping
Code:
zabbix_get [29535]: Get value error: Cannot connect to [xx.xx.xx.xxx:20006] [Connection refused]
So as you can see I've got a problem connecting to the host to retrieve that information, but I'm not really sure where/what is causing that issue. Someone else is charge of the firewall, so I'll be having them take a look and see if that's what's causing the problem, but if you see something that I may have overlooked that I need to change to get this working please let me know.
I'm also working towards some certifications and have been reading recently that ports don't necessarily need to be the same on both ends, and my understanding is that I could use port 20007 on my asterisk server to send to port 10051 on the zabbix server. Is that the case or do I need to change something else in order to get this working?
Comment