My ISP gave me this crappy modem, an Alcatel Speed Touch Home. Additionally, I recently started playing around with Zabbix, which nicely supports SNMP. I can create nice statistics from the machines in my network, including nice graphs and stuff. Well, almost all. Not the modem, because it does not support SNMP.
So, I needed a way to extract the interface statistics from the modem so I can create graphs in Zabbix like this:

This should be possible, somehow, right?
The solution
Basically, we are going to set-up a machine to act as a proxy for SNMP requests that should query the modem. The moment our ‘proxy’ receives a certain OID through SNMP, it will execute a script, which will call a binary, which will log in to the modem. The output of the script will be interpreted by snmpd and the results returned to the machine requesting the information, accordingly.
So, the requirements are:
- an Alcatel modem with telnet-interface,
- a recent version of net-snmp and a machine to act as a proxy for the SNMP requests,
- the utility ‘alcatell‘
- the script ‘traffic_passtest‘
That’s all there is to it. Read on for more details.
Modifying snmpd.conf
We have got to configure snmpd to execute a script whenever a certain piece of information is requested. (Before you got on making these modifications, make sure you have the ucd-snmp/pass mib-module amongst the enabled ones (–with-mid-modules=”ucd-snmp/pass”). Although I could see my script being run, it kept hitting me with a No Such Instance exists at this OID or something. After the re-compile, it did correctly returning the values.)
In my snmpd.conf, I added the following lines to call the ‘traffic_passtest’-script (see below):
pass .1.3.6.1.4.1.2021.9905 /path/to/traffic_passtest
The called script returns a MIB structure, like snmpd.conf’s man-page suggested and which basically gave me the whole idea for this solution.
The script
The ‘traffic_passtest’-script uses input from the program ‘alcatell‘ that queries a Alcatel modem by logging into the telnet-interface (see below). It parses the input from that program, and creates output that snmpd understands, which in turn Zabbix understands.
Download the script and open it in your favourite editor to specify the HOST, PASS and optional USER — without any credentials it will be impossible for it to log into the modem.
Note that the script uses a lame lock-mechanism to prevent it to run two at the same time, which would mess up the temporary files it uses to cache requests. (Too many requests do weird things to the telnet interface of the modem — I had to reset it once because it kept closing the connection.)
The program
This program ‘alcatell‘ automates the logging-in and execution of a certain command on the Alcatel modem. I wrote this specifically for the above purposes, but it can execute other commands as well. (Known limitation: only one command per execution.)
Calling the “ip iflist” command on the telnet-interface of the Alcatal modem will return interface statistics. This information can be perfeclty re-formatted into an above-mentioned MIB structure.
OK, so after modifying snmpd.conf, restart it, and test it:
# snmpwalk -v2c -c community localhost .1.3.6.1.4.1.2021.9905
UCD-SNMP-MIB::ucdavis.9905.1 = STRING: "Modem traffic statistics"
UCD-SNMP-MIB::ucdavis.9905.2 = Counter32: 2534874
UCD-SNMP-MIB::ucdavis.9905.3 = Counter32: 1710775
UCD-SNMP-MIB::ucdavis.9905.4 = Counter32: 2009477
UCD-SNMP-MIB::ucdavis.9905.5 = Counter32: 2630631
Yay, it works! Now onto the next step.
Configuration Zabbix
In order to actually use the information, we have to set-up a host in Zabbix. This is where that ‘Use IP address‘-checkbox really comes in handy.
Add a new host, for instance called ‘modem’, and tick ‘Use IP‘. As IP address, enter the IP address of the machine that is acting as a proxy for the modem, where the re-configured snmpd is running on:

Then, add items for all the OIDs we are interested in, .1.3.6.1.4.1.2021.9905.2 up to .1.3.6.1.4.1.2021.9905.5, like this:

At that point, Zabbix should be ready and monitoring those values and from it you will be able to generate graphs, trigger events and all the other stuff that it can do.

on
March 20th 2006 at 9:09 am in
no comments 








