Posted: Tue Oct 21, 2014 8:34 Post subject: HowTo - Zabbix and SNMP for dd-wrt, kong build
I wanted to try out Zabbix to see what kind of information I could pull out of my dd-wrt router.
Someone in the forum has stated that it is easy - and it is...... if you know how to do it.
I struggled a bit, but it is quite nice when it is up and running.
Zabbix is an open-source monitoring tool for networks, servers and applications.
Information around Zabbix can be found here:
www.zabbix.org www.zabbix.com
To try it out you need a Zabbix Server. The server can not run on the router, so it has to be established elsewhere.
I used my Windows 8.1 laptop.
Here are the steps I went through:
1) staging the Zabbix Server
2) enabling SNMP on dd-wrt
3) enabling Zabbix Client on dd-wrt
4) configuring the Zabbix Server
5) show some graphs
Staging the Zabbix server
Zabbix runs on different Linux Distro's.
I used the Zabbix Appliance for VMware/VirtualBox (.vmdk). http://www.zabbix.com/download.php
Note that the Appliance is for evaluation and not intended for production.
I used version 2.2.2 it worked out of the box. I tried version 2.4 but I experienced some issues getting an IP address for the VM and I didn't put any time into debugging the issue. I would assume that it can be fixed easily.
When the appliance is up and running then logon to the console.
Username: root
Password: zabbix
The console will display the frontend web address. In my case http://192.168.1.111/zabbix
The IP address of the Zabbix Server is needed when configuring the Zabbix Client on the router.
The Zabbix Frontend credentials is:
Username: Admin
Password: zabbix
Note that the username is "Admin" not "admin" as stated some places in the Zabbix documentation.
Enabling SNMP on dd-wrt using the GUI/Web Interface
1) Go to the "Services" tab and the "Services" sub-tab
2) Enable "SNMP", new options should appear
3) Fill in information in the SNMP section. (Location, Contact, Name, RO Community, RW Community) Keep the RO Community = "public" for easy configuration
4) Save Changes
Enabling Zabbix client on dd-wrt using the GUI/Web Interface
1) Go to the "Services" tab and the "Services" sub-tab
2) Enable "Zabbix Client"", new options should appear
3) Add the Zabbix Server IP address - in my case 192.168.1.111
Note: The Zabbix Client is included from kong's STD build 23075. Look in the changelog for more infp
Check if zabbix is running using the shell/cli:
~# ps| grep zabbix
1465 root 1876 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
1466 root 1876 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
1467 root 1884 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
1468 root 1884 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
1469 root 1884 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
1470 root 1884 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
1471 root 1884 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
If that is okay, check if /tmp/zabbix.conf contains the correct IPs:
ListenIP = is you routers internal LAN IP
Server = is the IP of your Zabbix Server
Telnet from the Zabbix Server to the router on port 10050. It can be done from the console - in my case telnet from 192.168.1.111:
~> telnet 192.168.1.1 10050
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
A bad response would be "Connection refused".
Another test would be to run the commend "zabbix_get -s 192.168.1.111 -k "agent.version".
You should get an output like this "2.0.9"
Configuring the Zabbix Server
Some templates are already available by default on the server, but one specific for DD-WRT is missing.
You have to upload this yourself.
It is located on the router under /etc/zabbix_template.xml from build 23310.
Logon the Zabbix server frontend and goto Configuration -> Templates. Import the zabbix_template.xml template. The button is located on the right side of the screen. You should have 38 before and 39 after.
When the template is imported, it is listed as Template_Linux_DDWRT.
Goto Configuration -> Hosts and press the Create host button.
Add the the dd-wrt router IP for Agent and SNMP interfaces, In my case 192.168.1.1
Press the Template tab and add Template_Linux_DDWRT and "Template SNMP Interface". Save the changes.
Get a beer and relax for an hour or so.
Show some graphs
Go to Monitoring -> Latest data. Select your router as host.
You can now select a graph for each of the polled values.
At this point you probably have a lot of questions about polling intervals, selected values, how to build graphs etc., but that has nothing to do with dd-wrt, so don't ask questions in this forum. Jump to zabbix.com and get your answers there.
Have fun!
Awesome instructions, thank you! Now if only I could figure out how to compile zabbix and mySQL on my NAS with a Marvell CPU... _________________ R7000 Nighthawk - DD-WRT v3.0-r50308
R7000 Nighthawk - DD-WRT v3.0-r50308
~~~~~~~~~~Dismantled for learning opportunities~~~~~~~~~~
WRT54Gv2
WRT54Gv8.2
~~~~~~~~~~Other Settings~~~~~~~~~
https://nextdns.io/?from=2d3sq39x https://pi-hole.net/ https://github.com/DNSCrypt/dnscrypt-proxy
This is probably a silly question, but despite a ton of googling I still can't figure out how to download the template from my router.
I've tried copying to permission-less local and nas samba shares using ssh and telnet putty sessions, but the copy fails reporting the destination folder is not writeable...?
Posted: Fri Oct 16, 2015 20:56 Post subject: Re: HowTo - Zabbix and SNMP for dd-wrt, kong build
PuzzleBrick wrote:
I wanted to try out Zabbix to see what kind of information I could pull out of my dd-wrt router.
Someone in the forum has stated that it is easy - and it is...... if you know how to do it.
I struggled a bit, but it is quite nice when it is up and running.
Zabbix is an open-source monitoring tool for networks, servers and applications.
Information around Zabbix can be found here:
www.zabbix.org www.zabbix.com
To try it out you need a Zabbix Server. The server can not run on the router, so it has to be established elsewhere.
I used my Windows 8.1 laptop.
Here are the steps I went through:
1) staging the Zabbix Server
2) enabling SNMP on dd-wrt
3) enabling Zabbix Client on dd-wrt
4) configuring the Zabbix Server
5) show some graphs
Staging the Zabbix server
Zabbix runs on different Linux Distro's.
I used the Zabbix Appliance for VMware/VirtualBox (.vmdk). http://www.zabbix.com/download.php
Note that the Appliance is for evaluation and not intended for production.
I used version 2.2.2 it worked out of the box. I tried version 2.4 but I experienced some issues getting an IP address for the VM and I didn't put any time into debugging the issue. I would assume that it can be fixed easily.
When the appliance is up and running then logon to the console.
Username: root
Password: zabbix
The console will display the frontend web address. In my case http://192.168.1.111/zabbix
The IP address of the Zabbix Server is needed when configuring the Zabbix Client on the router.
The Zabbix Frontend credentials is:
Username: Admin
Password: zabbix
Note that the username is "Admin" not "admin" as stated some places in the Zabbix documentation.
Enabling SNMP on dd-wrt using the GUI/Web Interface
1) Go to the "Services" tab and the "Services" sub-tab
2) Enable "SNMP", new options should appear
3) Fill in information in the SNMP section. (Location, Contact, Name, RO Community, RW Community) Keep the RO Community = "public" for easy configuration
4) Save Changes
Enabling Zabbix client on dd-wrt using the GUI/Web Interface
1) Go to the "Services" tab and the "Services" sub-tab
2) Enable "Zabbix Client"", new options should appear
3) Add the Zabbix Server IP address - in my case 192.168.1.111
Note: The Zabbix Client is included from kong's STD build 23075. Look in the changelog for more infp
Check if zabbix is running using the shell/cli:
~# ps| grep zabbix
1465 root 1876 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
1466 root 1876 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
1467 root 1884 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
1468 root 1884 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
1469 root 1884 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
1470 root 1884 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
1471 root 1884 S /usr/sbin/zabbix_agentd -c /tmp/zabbix.conf
If that is okay, check if /tmp/zabbix.conf contains the correct IPs:
ListenIP = is you routers internal LAN IP
Server = is the IP of your Zabbix Server
Telnet from the Zabbix Server to the router on port 10050. It can be done from the console - in my case telnet from 192.168.1.111:
~> telnet 192.168.1.1 10050
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
A bad response would be "Connection refused".
Another test would be to run the commend "zabbix_get -s 192.168.1.111 -k "agent.version".
You should get an output like this "2.0.9"
Configuring the Zabbix Server
Some templates are already available by default on the server, but one specific for DD-WRT is missing.
You have to upload this yourself.
It is located on the router under /etc/zabbix_template.xml from build 23310.
Logon the Zabbix server frontend and goto Configuration -> Templates. Import the zabbix_template.xml template. The button is located on the right side of the screen. You should have 38 before and 39 after.
When the template is imported, it is listed as Template_Linux_DDWRT.
Goto Configuration -> Hosts and press the Create host button.
Add the the dd-wrt router IP for Agent and SNMP interfaces, In my case 192.168.1.1
Press the Template tab and add Template_Linux_DDWRT and "Template SNMP Interface". Save the changes.
Get a beer and relax for an hour or so.
Show some graphs
Go to Monitoring -> Latest data. Select your router as host.
You can now select a graph for each of the polled values.
At this point you probably have a lot of questions about polling intervals, selected values, how to build graphs etc., but that has nothing to do with dd-wrt, so don't ask questions in this forum. Jump to zabbix.com and get your answers there.
Have fun!
I am running Kong build r27858 on a TEW-818DRU, and trying to set this up to be monitored by Zabbix. Maybe I am just stupid, but I cannot find anywhere on the Services Tab > Services Sub-Tab > Enable Zabbix Client. I have activated and tested SNMP, rebooted, checked every screen, etc. and there is no option anywhere in the GUI to "enable Zabbix Client" I must be missing something simple, but after hours of research I cannot find it.
I was able to build a custom Ubuntu 14.04 box, install Zabbix Server, and monitor a router via generic SNMP before trying to do this Zabbix-Specific monitoring. I am now trying to use the built-in zabbix client, which requires *FINDING* it first.
I already had a Zabbix server up and running and was surprised Zabbix was built into dd-wrt now(maybe its been there for a while?). I had an old linksys router i was using previously and never recalled seeing it before.
Its nice once you have it setup. I just used the template that is on the router. I had to change some of the interface references because they didnt match up. I setup a graph that monitors my downstream and upstream bandwidth. I setup some triggers to alert me when there is sustained download bandwidth usage averaging above a certain speed for X minutes.
I found a site that showed how to setup graphs to monitor the number of connections the firewall has open. It looked pretty slick. But it doesnt appear that the function they were using to check data in the file was an available option in zabbix by default. Any info to achieve this would be awesome.
I already had a Zabbix server up and running and was surprised Zabbix was built into dd-wrt now(maybe its been there for a while?).
That's the issue. It doesn't seem to be "Built-In" to my version. I need it to be in there, as we are working on a Zabbix project and SNMP is OK but I want the full functionality of Zabbix if possible.
That's the issue. It doesn't seem to be "Built-In" to my version. I need it to be in there, as we are working on a Zabbix project and SNMP is OK but I want the full functionality of Zabbix if possible.
I could be wrong but it might depend on the version you are using. On my router I am using v3... standard and its there on under Services tab at the very bottom. I have an older WRT54GS and its running v3 mini and its not there.
Posted: Sat Oct 17, 2015 21:41 Post subject: Zabbix Missing
I am running Kong build r27858 on a TEW-818DRU. I tried the version from TrendNET's Site (V.24 Pre-SP2 23800), I tried K3-ARM-STD from 10/16/2015, and I tried Kong r27858. Not there on any of them. We also tried to find it on a Linksys E1550 running DD-WRT, and also on an E2500 and none of these devices with any build of DD-WRT have a Zabbix option. I'd be glad to upload a screenshot to show this. Does anyone know what the deal is with the missing Zabbix?
Posted: Sat Oct 17, 2015 22:10 Post subject: Re: Zabbix Missing
sandman21 wrote:
I am running Kong build r27858 on a TEW-818DRU. I tried the version from TrendNET's Site (V.24 Pre-SP2 23800), I tried K3-ARM-STD from 10/16/2015, and I tried Kong r27858. Not there on any of them. We also tried to find it on a Linksys E1550 running DD-WRT, and also on an E2500 and none of these devices with any build of DD-WRT have a Zabbix option. I'd be glad to upload a screenshot to show this. Does anyone know what the deal is with the missing Zabbix?
Have you tried a recent non-Kong build? Im using the build from 9/11/2015. I think this one is for your router:
Posted: Wed Aug 31, 2016 20:58 Post subject: Trying another router for Zabbix
Well we gave up on the TEW-818DRU and are now thinking of trying this on DD-WRT NXT. Does anyone know if Zabbix Client will run on DD=WRT NXT? The routers in question are Buffalo Airstation Models WXR-1900DHPD and WSR-1166DD.