Resource icon

TUTORIAL Monitor your PBX using Zabbix 2.0

No permission to download

Hyksos

Guru
Joined
May 28, 2011
Messages
474
Reaction score
69
Hyksos submitted a new resource:

Monitor your PBX using Zabbix - Installing Zabbix to obtain a self monitoring PBX with endless possibilities.

The zip file contains a tar.gz, an XML file and pdf with complete instructions including pictures.

This will install Zabbix onto the PBX and allow it to monitor itself.
It will monitor the machine itself and asterisk.
Graphs will be available for your viewing and historical information will be kept.

For a home installation, it might be way overkill, for a production PBX I'm sure many will look into it and add monitored items on top of the initial selection provided here. If not... well I...
Read more about this resource...
 
  • Like
Reactions: wardmundy

DaveDog

Member
Joined
Jun 12, 2013
Messages
46
Reaction score
4
this was displayed when installing after clicking finish:

  • Error in query [SELECT u.userid,u.attempt_failed,u.attempt_clock,u.attempt_ip FROM users u WHERE u.alias='guest' AND u.userid BETWEEN 000000000000000 AND 099999999999999] [Table 'zabbix.users' doesn't exist]​
 

DaveDog

Member
Joined
Jun 12, 2013
Messages
46
Reaction score
4
that error keeps popping up when attempting to access the Gui http://ip address/zabbix

no username or password dialog boxes are displayed

tried restarting the zabbix service, no change
 
Joined
May 23, 2013
Messages
223
Reaction score
28
Location
Troy, Ohio
SYSTEM INFORMATION *VERIFIED*─────────────────────┐
│ Asterisk = ONLINE | Dahdi = ONLINE | MySQL = ONLINE │
│ SSH = ONLINE | Apache = ONLINE | Iptables = ONLINE │
│ Fail2ban = ONLINE | Internet = ONLINE | Ip6Tables = ONLINE │
│ Disk Free = ADEQUATE| Mem Free = ADEQUATE| NTPD = ONLINE │
│ SendMail = ONLINE | Samba = OFFLINE | Webmin = ONLINE │
│ Ethernet0 = ONLINE | Ethernet1 = ONLINE | Wlan0 = N/A │
│ │
│ PIAF Installed Version = 2.0.6.4 under *HARDWARE* │
│ FreePBX Version = 2.11.0.11 │
│ Running Asterisk Version = 1.8.24.0 │
│ Asterisk Source Version = 1.8.24.0 │
│ Dahdi Source Version = 2.7.0.1 │
│ Libpri Source Version = 1.4.14 │
│ IP Address = 10.10.82.19 on eth0 │
│ Operating System = CentOS release 6.4 (Final) │
│ Kernel Version = 2.6.32-358.23.2.el6.x86_64 - 64 Bit │
│ Incredible Version = UNKNOWN

Followed your install PDF exactly, during install saw the following errors during the script:
./install-zabbix-ast.sh: line 8: /usr/share/doc/zabbix-server-mysql-2.0.8/create/schema.sql: No such file or directory
./install-zabbix-ast.sh: line 9: /usr/share/doc/zabbix-server-mysql-2.0.8/create/images.sql: No such file or directory
./install-zabbix-ast.sh: line 10: /usr/share/doc/zabbix-server-mysql-2.0.8/create/data.sql: No such file or directory

Still was able to access the setup, everything was working and the database test was good, after getting to the end now it just comes up with a login error:
  • mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) [include/db.inc.php:77]
 
Joined
May 23, 2013
Messages
223
Reaction score
28
Location
Troy, Ohio
Okay was able to edit /etc/zabbix/web/ zabbix.conf.php and change the login info it didn't save for some reason. Now I can pull up the login GUI but it's giving another error I can hardly see since it's scrolling off screen for some reason.
  • Error in query [SELECT u.userid,u.attempt_failed,u.attempt_clock,u.attem"pt_ip FROM users u WHERE u.alias='guest' AND u.userid BETWEEN 000000000000000 AND 099999999999999] [Table 'zabbix.users' doesn't exist]
 
Joined
May 23, 2013
Messages
223
Reaction score
28
Location
Troy, Ohio
Okay login problem solved, your script was calling

/usr/share/doc/zabbix-server-mysql-2.0.8

its actually

/usr/share/doc/zabbix-server-mysql-2.0.9

changing that and then creating the databases works and you can now log in.
 

Hyksos

Guru
Joined
May 28, 2011
Messages
474
Reaction score
69
yes I will update it and generalize it for future version.

DaveDog
run those:
sed -i '1s/^/USE zabbix;\n/' /usr/share/doc/zabbix-server-mysql-2.0.9/create/schema.sql
sed -i '1s/^/USE zabbix;\n/' /usr/share/doc/zabbix-server-mysql-2.0.9/create/images.sql
sed -i '1s/^/USE zabbix;\n/' /usr/share/doc/zabbix-server-mysql-2.0.9/create/data.sql
mysql --user=root --password=passw0rd < /usr/share/doc/zabbix-server-mysql-2.0.9/create/schema.sql
mysql --user=root --password=passw0rd < /usr/share/doc/zabbix-server-mysql-2.0.9/create/images.sql
mysql --user=root --password=passw0rd < /usr/share/doc/zabbix-server-mysql-2.0.9/create/data.sql

then continue where you left off. that's the current problem.

And look back here because I also think I forgot to make sure zabbix-server and zabbix-agent start at boot.
Will work correct this too. and post back here when I get home.
 

Hyksos

Guru
Joined
May 28, 2011
Messages
474
Reaction score
69
Before I upload the new script and for DaveDog and Chris Sweeney
chkconfig --level 2345 zabbix-server on
chkconfig --level 2345 zabbix-agent on

will make both start at boot.
This should have been in the original script.
 
  • Like
Reactions: Chris Sweeney

Hyksos

Guru
Joined
May 28, 2011
Messages
474
Reaction score
69
Tested from scratch and it works, better now they start on boot.

If someone is stuck in between like Dave just say and it will be an easy fix.
I will also post an uninstall script soon. So this will also serve those who might encounter problems or want to start from scratch or simply want to remove Zabbix and modifications done by the script.
 

Hyksos

Guru
Joined
May 28, 2011
Messages
474
Reaction score
69
Also wanted to bring attention to the following thing because 300 seconds can be long when you're waiting to see if zabbix is effectively catching on something you'd like to see.

Check the screenshot for directions:
then Click on the item you which to edit.
then find the field called Update interval (in sec):
Put it lower then 300 sec if desired.

Of course checking how long asterisk has been running or the version... could be less often then 300 seconds...
Adjust each as desired. But don't exaggerate like checking stuff every second...
For someone who has a problem with loosing extensions or a specific extension, you could check every 30 sec or something like that until you find the issue.

Just to be sure you guys know how to change that, especially to play around and check what works... A five minute test call is kinda long :)
 

Attachments

DaveDog

Member
Joined
Jun 12, 2013
Messages
46
Reaction score
4
Thank you very much Hyksos, working like a champ.

Need to spend some time trying to figure out how to monitor interface statistics...
 

Hyksos

Guru
Joined
May 28, 2011
Messages
474
Reaction score
69
Incoming and outgoing traffic are already monitored.
Which metric do you want to monitor?
 

Hyksos

Guru
Joined
May 28, 2011
Messages
474
Reaction score
69
Yes, if you find a way to do something without adding any additional load on a server, msg me, I'm interested :)

Everybody here should be clear about the fact that if you want to monitor anything more than the PBX itself, a single global zabbix running in another VM/host is how you usually would use zabbix of course.

It doesn't mean it shouldn't be installed directly on it to create an auto reporting PBX... if you don't plan on monitoring other stuff or if it's your first zabbix.
I will be glad if people start using this and move on to standalone zabbix, that's always the plan with zabbix, if not standalone, on your hypervisor or on another small machine if you don't have a big network to monitor...

So I still agree that my PBX is not the place I go to install more software... any other server is potentially better but the home PBX or small business PBX might want to self-monitor when the site where the PBX is, is not running a better host for the zabbix server.

You should also know that Zabbix is known to scale well, so what we're asking zabbix here is Nothing... I monitor thousands of servers hosting hundreds of internal and external services and it's all done on a handful of zabbixes. None of those are asterisks though so don't go thinking I'm an asterisk monitoring guru.. What's in the template is a basic but useful base, that would only grow once you find what metrics you need or want out of it.
 

MGD4me

Guru
Joined
Feb 3, 2009
Messages
429
Reaction score
56
Location
British Columbia
Yes, if you find a way to do something without adding any additional load on a server, msg me, I'm interested :)
Yes... me too!

My original question was poorly stated, in retrospect. I was more curious in knowing how much of a load this app imposes, if possible. If Zappix is a resource hog, then it might be better that it be installed on another server other than the PiAF platform, as you mentioned. But if you noticed only a minimal system load, that would be good news for the smaller SOHO environment. For this scenario having a simpler network topography would be an advantage, if the imposed penalties were not severe. Even an elephant can learn to balance on a ball. Oops... not politically correct anymore. Did I say that out loud?
 
Joined
May 23, 2013
Messages
223
Reaction score
28
Location
Troy, Ohio
I like this and I'm glad you posted it, I want to set up one server to monitor all my PBX boxes here which it seems Zabbix will be great for. Now to make it all work LOL.
 

chewie

Member
Joined
Sep 17, 2013
Messages
33
Reaction score
1
Does this work on PIAF 2.11?

I have installed a fresh Zabbix server in my VM environment (where the PBX also lives) and configured everything, attached the template to the host entry, etc.
Zabbix agent is up and running and configured on the PBX end.
Since I'm behind a hardware firewall I have local IPTABLEs (v6 as well) disabled so I know the firewall is not an issue.

The Asterisk info does not seem to be updating at all but the regular Linux data does (also attached a linux template).

Not sure what to look at otherwise?
 

Members online

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,514
Messages
138,537
Members
14,644
Latest member
goseph