Zenus - The Zen ADSL Usage Monitor

Submitted by Falken on Sun, 07/01/2007 - 16:46

Zenus is a Perl interface to the Zen ADSL usage web service.

It features:

  1. A Perl module (zenUsage.pm) to handle the actual communication to the web service that can also be used to build your own custom interfaces
  2. Two example front ends to the module - the main zenus.pl script and a debugging client

Zenus is ideal if you want to integrate 3rd party monitoring systems like Cacti (which used Zenus to produce the attached graph) or if you run Linux and don't or can't make use of the cross-platform Firefox plug-in.

Zenus v2 now longer works due to changes at Zen

A version 3 is in early testing. Please contact me if you want to test it.


mattjgalloway (not verified)

Fri, 08/03/2007 - 00:01

Hey! Amazing work here - EXACTLY what I was looking for since switching to the Zen 8000 Active package yesterday! I've also just started using Cacti on my router. Is there any chance you could guide me as to how you attached it to using Zenus? Great work! Matt

mattjgalloway (not verified)

Fri, 08/03/2007 - 09:25

I'm actually slowly getting it to work with Cacti and I now have it logging everything into Cacti and drawing a pretty graph. I'd quite like to get it packaged into a template for Cacti though - have you thought about doing that? I might package mine and release it... might go nicely with Zenus...


Mon, 08/06/2007 - 14:32

In reply to by mattjgalloway (not verified)

I'd certainly take a look and maybe add it to the Zenus distribution / web page.

I've been meaning to do it myself (to show you how to go from the Perl to the graph on this page), but I've not got round to putting all the zenus.pl output's into the data source yet.

Send me what you have ;-)


Yep, sure thing, I'll send it over later. Where do you want me to send it to? I've got mine logging usage, available, estimated current month and total cap at the moment. It's simple to add in the structure for the other variables which come from Zenus.

My email address is in the README file in the distribution, or use my username (or name from the footer of comments) @ the domain of this web page (minus the www., if present).


Anonymous (not verified)

Fri, 03/21/2008 - 18:42

Just installed zenus and all required modules, but I get this error message when I run zenus.pl with my portal username and password: 500 Can't connect to webservices.zen.co.uk:443 (Illegal seek) at zenus.pm line 141 How to fix this? Thanks

Odd error that.
Please let me have the output of using 'debug.pl', your Linux distribution name and version and your Perl version.

(edit the following Monday)Fixed by making sure Crypt::SSLeay is installed. README updated.


Martin Davies (not verified)

Sat, 03/14/2009 - 13:05

Hi. Am preparing a simple script based on your work for use with Munin and as part of this, Munin calls a version of your Perl script zenus.pl via a soft link. I get an answer but seem to have unlocked some warning messages from SOAP::Lite.pm and I also found one (corrected) in Zenus.pm. Error strings are: martin@mended-drum:/usr/local/lib/site_perl$ munin-run zenin Use of uninitialized value $name in substitution (s///) at /usr/local/share/perl/5.10.0/SOAP/Lite.pm line 1055. Use of uninitialized value $name in exists at /usr/local/share/perl/5.10.0/SOAP/Lite.pm line 1056. Use of uninitialized value $name in hash element at /usr/local/share/perl/5.10.0/SOAP/Lite.pm line 1056. Use of uninitialized value $name in hash element at /usr/local/share/perl/5.10.0/SOAP/Lite.pm line 1060. Use of uninitialized value $name in hash element at /usr/local/share/perl/5.10.0/SOAP/Lite.pm line 1060. [...] But I do get the right answer at the end: Available.value 26.3388671875 Remaining.value 12.9140625 Used.value 13.4248046875 The 'correction' in zenus.pm was on line 336. I believe the code snippet print "accounts $1 $2 $3 ... \n" unless $hideDebug; my $result; push @result,$1; push @result,$2; should read print "accounts $1 $2 $3 ... \n" unless $hideDebug; my @result;

Good spot on the $result mistake :-)

At a guess, your code is running using 'perl -w' which will spit out all sorts of warnings. Remove the -w to stop them appearing.


Anonymous (not verified)

Sun, 04/25/2010 - 19:06

your month indexes are off by one, in sub estimateRemaining the calculation for days in months should be the following


if (($month == 3) || ($month == 5) || ($month == 8) || ($month == 10)) {
                $length = 30;
        }elsif($month == 1 && _isLeapYear($year)) {
                $length = 29;
        }elsif ($month == 1) {
                $length = 28;
        } else {
                $length = 31;


as the return mon entry in localtime is 0 january, 1 for febuary and so on