Dinstar equipment doesn't offer you any kind of monitoring tool apart from the web management page. Although there is a telnet interface which you can, somehow, automate to give you information, this job is rather an obstacle than a solution.
With the scripts on this repository, you can setup a basic monitoring system using an intermediate database and a screen scrapping script which connects to the webmin page of every gateway you want and writes down the parsed html information to a database which you can consult later using whatever tool you prefer.
The tool I preferred was Nagios, but it doesn't work all by itself so I wrote another four scripts to take care of the ASR, PDD, Time Limit and port signal captured all by the main script.
You can, however, choose to ignore the Nagios scripts since they are completely independent one from another.
- perl
- curl
- crond (optional)
- Clone the repository
- setup the database connection
# mysql mysql> create database dinstar; # mysql dinstar < sql/dinstar.sql
- Edit db.pm file with your database credentials
use constant DB => 'dinstar'; use constant USER => 'root'; use constant PWD => ''; use constant HOST => 'localhost';
- Test the script execution
Usage: dinstar-ports-parser.pl <ip> <user> <password> <number-of-ports> # perl dinstar-ports-parser.pl 192.168.111.99 admin admin 8
- Get to your database client and check if the rows were inserted properly
select * from port;
- If you want to constantly check for updates, you can put the script in a crontab to run every 5 minutes or so.
*/5 * * * * perl /root/dinstar-util/dinstar-ports-parser.pl 192.168.111.99 admin admin 8
- Put the scripts in the plugins directory
- Setup the new commands in the command.cfg file using the parameters you want.
Example: define command{ command_name check-dinstar-limit command_line $USER1$/check-dinstar-limit -h$HOSTADDRESS$ -w30 -c15 }
- Setup a new checking in your service.cfg file
- Restart nagios
I don't want to get into much detail on Nagios configuration since there are plenty of material out there to setup plugins. If you are willing to use these scripts I'm pretty sure you alrealy know how to use and configure Nagios ;)