ZyXEL Statistics - CPU/Firewall/NAT - Updated Oct 20 2006

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Post Reply
Author
Message
User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

ZyXEL Statistics - CPU/Firewall/NAT - Updated Oct 20 2006

#1 Post by BSOD2600 » Fri Jan 20, 2006 6:24 pm

I am no longer supporting this script, since ZyXEL's Telnet feature is buggy, resulting in the router rebooting frequently. ZyXEL will not fix the problem.

I've rewritten the existing PHP script I had to collect NAT statistics from my ZyXEL P334W router. Now it collects CPU usage, firewall stats and NAT stats. See the attached pics below for examples. This script should work with most ZyXEL routers, since they all allow telnet access to the ZyNOS (aka OS).

The CPU usage graph is simply the 'fire cpu usage' script found here on the forum; I didn't make it.

The script, templates and readme are in the zip file. Templates were exported with Cacti 0.8.6i, so you'll need that to successfully import.
Attachments
Zyxel_stats.zip
Instructions, scripts, template
(67.4 KiB) Downloaded 2655 times
zyxel_stats_sample.png
Sample output.
zyxel_stats_sample.png (53.58 KiB) Viewed 30751 times
Last edited by BSOD2600 on Thu Oct 04, 2007 6:32 pm, edited 3 times in total.

carfesh
Posts: 1
Joined: Sat Feb 11, 2006 3:59 am
Location: Düsseldorf, Germany
Contact:

#2 Post by carfesh » Sat Feb 11, 2006 4:04 am

I have a Prestige 650 HW-37; for that one I had to adapt the interface to say wanif0, and the values that are read are broader than searched for by the script (can be up to 7 or maybe more?).

Attached the modified zyxel_nat.php file..
Attachments
zyxel_nat.zip
(1.02 KiB) Downloaded 1297 times

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

#3 Post by BSOD2600 » Fri Oct 20, 2006 8:10 pm

Bump.

Updated the templates and script. No longer php based and now is Perl.

bartbauldry
Posts: 2
Joined: Fri Feb 09, 2007 8:16 am

problem

#4 Post by bartbauldry » Fri Feb 09, 2007 9:02 am

Hello I seem to be having a problem getting this to work,

When i import the graph templates i get this error:

[success] ZyXEL - NAT Statistics [new]
+ Unmet Dependency: (Data Template Item) allocated
+ Unmet Dependency: (CDEF) Make Per 5 Minutes
+ Unmet Dependency: (GPRINT Preset) Normal
+ Unmet Dependency: (Data Template Item) expired
+ Unmet Dependency: (Data Template Item) freed
+ Unmet Dependency: (Data Template Item) Cachehit
+ Unmet Dependency: (Data Template Item) full

This is after importing the data template and i get these errors on all the graph templates that i import.

when i run the perl script from the console i get these reults:

C:\Inetpub\wwwroot\cacti\scripts>perl zyxel_stats.pl IPADDRESS PASSWORD

Tablesize: Allocated: Freed: Full: Expired: Cachehit: cpu:2.430 ICMPIdle:47 UDPI
dle:2878 TCPIdle:11 TCPSYNIdle:94 TCPFINIdle:71 LandAttack:0 IPSpoof:5 ICMPEchoAttack:0 ICMPAttack:0 NetBIOSAttack:0 TraceRouteAttack:0 TearDropAttack:0 SynFloodAttack:0 SMTPAttack:0

i guess that its communicating correctly with the router.... but i cant seem to get the graphs to show and data.

I am using cacti-0.8.6i as specified.

Any ideas?

Thanks

Bart

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

#5 Post by BSOD2600 » Fri Feb 09, 2007 12:46 pm

Hmm, I can try to re-export the graph templates and see if that fixes anything.

Actually, I stopped using this script because it would lockup my ZyXEL P334W after several days of polling. ZyXEL tech support from Taiwan said the CLI wasn't meant for collecting data so it's not something they're going to fix.

fury
Posts: 8
Joined: Sun Dec 31, 2006 6:57 am

#6 Post by fury » Fri Feb 09, 2007 3:56 pm

hi,

could this template work for a linux cacti?

thx

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

#7 Post by BSOD2600 » Fri Feb 09, 2007 5:07 pm

Yes, it's not OS specific -- its router specific.

fury
Posts: 8
Joined: Sun Dec 31, 2006 6:57 am

#8 Post by fury » Sat Feb 10, 2007 9:11 am

ok, thx.

when i execute the zyxel_stats.pl i get this output:

Code: Select all

Can't locate Net/Telnet.pm in @INC (@INC contains: /usr/lib/perl5/5.8.8/i586-linux-thread-multi /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i586-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl .) at zyxel_stats.pl line 38.
BEGIN failed--compilation aborted at zyxel_stats.pl line 38.
how can i fix that?

thx
andre

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

#9 Post by BSOD2600 » Sun Feb 11, 2007 2:47 pm

You didn't read the included readme.txt file.

bartbauldry
Posts: 2
Joined: Fri Feb 09, 2007 8:16 am

Thanks

#10 Post by bartbauldry » Mon Feb 12, 2007 4:54 am

Hello thanks for the response. I think ill give it a miss, my router is as a tad touchy and seems to crash alot, there for this may be a bad idea for its already odd nature.

Thanks again.

fury
Posts: 8
Joined: Sun Dec 31, 2006 6:57 am

#11 Post by fury » Tue Feb 13, 2007 10:45 am

hi,

sorry, i hate reading the manuals 8) :D

ok, i installed net/telnet.

but what do you mean with
Replace all instances of P334W with your routers command prompt
hostname from the router?

does this script work with an zyxel zywall 35?

thx
Andre

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

#12 Post by BSOD2600 » Tue Feb 13, 2007 11:29 am

I mean, you must edit the perl file, find everywhere where it has 'P334W' and replace it with the commandline prompt for your router (logon to the commandline and look what yours uses).

I have no idea if this script works with your router. But the fact that ZyXEL won't fix the problems in mine, means I'm not using this script anymore.

fury
Posts: 8
Joined: Sun Dec 31, 2006 6:57 am

#13 Post by fury » Tue Feb 13, 2007 12:11 pm

ok thx.

i think it would not work. my router has a webinterface for configuration and yours is fully managed.

but, thanks a lot for your help!

best regards from germany

Andre

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

#14 Post by BSOD2600 » Tue Feb 13, 2007 5:18 pm

Try telnetting into it...

Post Reply