Forget about SNMP, Cacti, MRTG

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Mon Dec 13, 2010 18:07    Post subject: Forget about SNMP, Cacti, MRTG Reply with quote
Thanks to Kong, who compiled the Zabbix agent for me, we now have the ability to run a zabbix agent on our DD-WRT router.

Zabbix is a monitoring server that can do all kinds of checks on different platforms. The agent is about 300 KB and the first thing I did was compare it to the snmpd daemon which is 500 KB.

SNMP is a standardized system to monitor/control systems, but that's where its usefullness stops more or less.

I will write a supporting script for it, so you're able to turn it on/off with OTRW.

I will include some of the scripts I already wrote like checking for a change in iptables.....

http://www.zabbix.com/
http://www.zabbix.com/forum/forumdisplay.php?f=11

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
Sponsor
Masterman
DD-WRT Guru


Joined: 24 Aug 2009
Posts: 2070
Location: South Florida

PostPosted: Mon Dec 13, 2010 19:12    Post subject: Reply with quote
Awesome man...You are a machine! Wink

Ill talk to you on Skype Cool

_________________
Optware, the Right Way
Asus RT-AC68U
Asus RT-N66U
Asus RT-N10
Asus RT-N12
Asus RT-N16 x5
Asus WL520gU
Engenious ECB350
Linksys WRT600Nv1.1
Linksys WRT610Nv1
Linksys E2000
Netgear WNDR3300
SonicWall NSA220W
SonicWall TZ215W
SonicWall TZ205W
SonicWall TZ105W
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Tue Dec 14, 2010 21:07    Post subject: Reply with quote
I have created a Zabbix template for DD-WRT based on the Linux template.
I also added some special items/triggers that I previously wrote for Zabbix.

Don't waste your time with other monitoring systems. Especially if you want to monitor DD-WRT.



zabbix_DDWRT.xml.txt
 Description:

Download
 Filename:  zabbix_DDWRT.xml.txt
 Filesize:  115.68 KB
 Downloaded:  2530 Time(s)


_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
jumran
DD-WRT User


Joined: 31 Jul 2009
Posts: 492
Location: Toronto, ON, CA

PostPosted: Fri Dec 17, 2010 6:19    Post subject: Reply with quote
Does this tool also require server side software and if so, does the server side software support Windows? Also are there any tutorials on how to set it up?

frater wrote:
I have created a Zabbix template for DD-WRT based on the Linux template.
I also added some special items/triggers that I previously wrote for Zabbix.

Don't waste your time with other monitoring systems. Especially if you want to monitor DD-WRT.

_________________
Asus RT-N16 [Build King Kong 18050M NEWD-2 K2.6 + Optware + My Page] Mr. Green
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sat Dec 25, 2010 8:50    Post subject: Reply with quote
jumran wrote:
Does this tool also require server side software and if so, does the server side software support Windows? Also are there any tutorials on how to set it up?

Yes, it requires you to setup a server with PHP/Apache. @home I have a HTPC running Windows 7 with vmware server which is running 3 virtual machines (2x Ubuntu Lucid Lynx, 1 Windows 2000).

It took me almost no time to setup Zabbix on that machine which already was running websites.

Here's a new and enhanced template for DD-WRT



zabbix_DDWRT.xml.txt
 Description:

Download
 Filename:  zabbix_DDWRT.xml.txt
 Filesize:  104.72 KB
 Downloaded:  2127 Time(s)


_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sat Dec 25, 2010 13:05    Post subject: Reply with quote
I wrote some additions to zabbix that are quite powerful. Of course they are added to the one I install with optware.

They are called "regtop" and "regcount". They return the amount of lines that hold a certain regular expression since you last called it.

With regtop you can easily extract info from files..



sshot-13.jpg
 Description:
 Filesize:  67.33 KB
 Viewed:  48691 Time(s)

sshot-13.jpg



sshot-12.jpg
 Description:
 Filesize:  171.58 KB
 Viewed:  48691 Time(s)

sshot-12.jpg



sshot-11.jpg
 Description:
 Filesize:  251.61 KB
 Viewed:  48691 Time(s)

sshot-11.jpg



_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sat Jan 01, 2011 11:23    Post subject: Reply with quote
I decided to show the graph of a serious server I'm monitoring using my 'regcount' and Zabbix.
18.000 ~ 24.000 connections....

Here it's just counting all the lines in /proc/net/ip_conntrack.
Yes... it's thousands of connections and they are all valid....

Because you scan log-files as well, you can also react on errors, warnings or just info that's generated by a service. With SNMP you can merely get the straight data and most services don't even support SNMP.



sshot-16.jpg
 Description:
 Filesize:  241.25 KB
 Viewed:  48535 Time(s)

sshot-16.jpg



_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
pizzulicchio
DD-WRT User


Joined: 16 Dec 2009
Posts: 83
Location: Florence (ITALY)

PostPosted: Sun Jan 02, 2011 22:36    Post subject: DD-WRT zabbix agent Reply with quote
Hi,
Where is the link to the zabbix_agent for DD-WRT? i'm very, very interested to it!
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Mon Jan 03, 2011 0:17    Post subject: Reply with quote
It's part of OTRW,
Maybe this link will help you.
Code:
wget -O /tmp/zabbix.tgz http://wd.mirmana.com/zabbix.tgz && /opt/bin/tar xvzf /tmp/zabbix.tgz -C/
rm /tmp/zabbix.tgz 2>/dev/null

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)


Last edited by frater on Mon Jan 03, 2011 12:44; edited 1 time in total
pizzulicchio
DD-WRT User


Joined: 16 Dec 2009
Posts: 83
Location: Florence (ITALY)

PostPosted: Mon Jan 03, 2011 10:29    Post subject: Zabbix agent dd-wrt is now working Reply with quote
I'm sorry...
I had not seen that already existed in /opt/etc/zabbix/zabbix_agentd.conf
Ok, perfect!
I have just configured the agent but it seems to not be able to write the pid file into /tmp/zabbix_agentd.pid

I have edited the zabbix_agentd.conf setting up to write the pid file into /opt

I have created the pid file in /opt

touch /opt/zabbix_agentd.pid

and i have changed the permission with

chmod 777 /opt/zabbix_agentd.pid

( zabbix user has no right to write access )


Cool! Very cool!
Zabbix agent is fully working!

I have two questions:

1) it would be possible to update the agent to 1.8.3 instead of 1.6.2? ( avaiable as ipkg should be and idea)

2) What is this?

wget -O /tmp/zabbix.tgz http://${dom}/zabbix.tgz && /opt/bin/tar xvzf /tmp/zabbix.tgz -C/
rm /tmp/zabbix.tgz 2>/dev/null
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Mon Jan 03, 2011 12:43    Post subject: Re: Zabbix agent dd-wrt is now working Reply with quote
pizzulicchio wrote:
I'm sorry...
I had not seen that already existed in /opt/etc/zabbix/zabbix_agentd.conf
Ok, perfect!
I have just configured the agent but it seems to not be able to write the pid file into /tmp/zabbix_agentd.pid

I have edited the zabbix_agentd.conf setting up to write the pid file into /opt
and what is supposed to be the added value of this?
It writes fine to /tmp
pizzulicchio wrote:
I have created the pid file in /opt

touch /opt/zabbix_agentd.pid

and i have changed the permission with

chmod 777 /opt/zabbix_agentd.pid

( zabbix user has no right to write access )
You mean a solution for a problem you just created. (sorry for being sarcastic)
pizzulicchio wrote:

Cool! Very cool!
Zabbix agent is fully working!
I'm glad you like it
pizzulicchio wrote:

I have two questions:

1) it would be possible to update the agent to 1.8.3 instead of 1.6.2? ( avaiable as ipkg should be and idea)
It's not part of optware. It's compiled on my request by Kong. He had dependency problems with 1.8.x and used 1.6.2
pizzulicchio wrote:

2) What is this?

wget -O /tmp/zabbix.tgz http://http://wd.mirmana.com/zabbix.tgz && /opt/bin/tar xvzf /tmp/zabbix.tgz -C/
rm /tmp/zabbix.tgz 2>/dev/null
It's the latest config and supporting scripts I wrote....
It's done in prep_optware, but just before I gave you that link I made sure it contained the latest updates.... (a template is included in /opt)
I did see I forgot to translate the domain (corrected now)

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
pizzulicchio
DD-WRT User


Joined: 16 Dec 2009
Posts: 83
Location: Florence (ITALY)

PostPosted: Mon Jan 03, 2011 15:08    Post subject: Reply with quote
I have reinstalled OTRW and now zabbix agent is be able to write the pid file to the /tmp folder.
I don't know how and why but my problem is solved.

I'm using zabbix from version 1.4 and i think that it's a very complete monitoring system solution.

I hope in a future 1.8.x agent porting...

How is possible to keep updated zabbix agent at the moment? Running your script sometime?

Let me know and thankyou very very much for this work!
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Mon Jan 03, 2011 17:27    Post subject: Reply with quote
pizzulicchio wrote:
I'm using zabbix from version 1.4 and i think that it's a very complete monitoring system solution.

I hope in a future 1.8.x agent porting...
Agents and server don't need to be the same version. I'm running Server 1.8.3. Don't worry about updating the agent...

Have you noticed the custom linux functions I wrote (and are also working for DD-WRT)? Are you using the custom template I made for DD-WRT (in /opt)?

It enables me to extract almost anything in a very easy way, sometimes even without changing anything on the clients.... (regtop, regcount)

Today I wrote a tool to fetch the speed/integrity of your DNS.

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
pizzulicchio
DD-WRT User


Joined: 16 Dec 2009
Posts: 83
Location: Florence (ITALY)

PostPosted: Mon Jan 03, 2011 23:03    Post subject: Reply with quote
Sure!
I have noticed and installed your template as soon as i saw it into opt.
After the template's import i have found this post and i have asked information about zabbix because I had not noticed that it was already present in /opt
:-)

Your template is very useful and i'm using it.
The trigger "ipv4 interfaces have been changed on server" is the best thing that an human can do! Smile
Now i'm be able to know when my adsl has gone down and up changing ip address.

Only a few bits of advice

I think it would be useful to add some information about wireless section into this template :
1)the number of clients currently connected via wireless
2)the mac address of clients currently connected
3)the signal quality of clients ( signal capcity, db, %strenght )

Should be possible to retreive this value somehow?
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Tue Jan 04, 2011 7:23    Post subject: Reply with quote
pizzulicchio wrote:
Should be possible to retreive this value somehow?
Yes, I think so.... I just need time....
_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum