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

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

Moderators: Developers, Moderators

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

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

Post by BSOD2600 »

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 2851 times
Sample output.
Sample output.
zyxel_stats_sample.png (53.58 KiB) Viewed 33281 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:

Post by carfesh »

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 1449 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

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

Post by bartbauldry »

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: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

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: 13
Joined: Sun Dec 31, 2006 6:57 am

Post by fury »

hi,

could this template work for a linux cacti?

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

Post by BSOD2600 »

Yes, it's not OS specific -- its router specific.
fury
Posts: 13
Joined: Sun Dec 31, 2006 6:57 am

Post by fury »

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: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

You didn't read the included readme.txt file.
bartbauldry
Posts: 2
Joined: Fri Feb 09, 2007 8:16 am

Thanks

Post by bartbauldry »

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: 13
Joined: Sun Dec 31, 2006 6:57 am

Post by fury »

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: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

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: 13
Joined: Sun Dec 31, 2006 6:57 am

Post by fury »

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: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Try telnetting into it...
Post Reply

Who is online

Users browsing this forum: vickers29525 and 3 guests