Port Monitor

Addons for Cacti and discussion about those addons

Moderators: Moderators, Developers

Post Reply
Posts: 16
Joined: Mon Sep 30, 2013 12:24 am

Port Monitor

#1 Post by Akven » Fri Sep 09, 2016 1:43 am

I wonder if there is a simple way to monitor port status (up/down)?
We are using Weathermap plugin, but it took a lot of time to add switches and ports on the map.

I just need some automatic tool, that would display status of selected equipment and status of its selected ports on one map or in one table.

For example:
Cisco 01 (green) - Port 01 (green) Port 02 (red)
Cisco 02 (green) - Port 07 (green)
Cisco 03 (red) - Port 10 (red)

Its really annoying to create weathermaps for 1000+ ports and manage changes cause everything in weathermap needs to be done by hands.

Maybe there is some other monitoring with such functionality besides Cacti?

Cacti User
Posts: 151
Joined: Mon May 31, 2010 9:26 am

Re: Port Monitor

#2 Post by Atreides » Thu Oct 20, 2016 2:22 pm

There are ....TONS :) of guides regarding monitoring port status on this forums. I myself tried at least 4-5 ways, all worked in different ways and got the same result.
First : Graph your interface port/status (I think, last time I used this guide : https://kb.groundworkopensource.com/dis ... tus+checks)
In this first step I had to do a small change :

In : /var/www/html/cacti/lib/snmp.php

define("REGEXP_SNMP_TRIM", "/(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):/i");


define("REGEXP_SNMP_TRIM", "/(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):|(up|down)\(|\)$/i");
Then add this graph interface status for every switch, every port.
Then in weathermap :
You need a scale

SCALE ifstatus 0 0.99 255 209 71 2
SCALE ifstatus 1 1 0 255 0 1
SCALE ifstatus 1.01 2 255 209 71 2

And this code for every port(you have to calculate position 'tho, few trials and errors here, but I think you can make some script, if you have thousands of switches and ports)

Here are 2 ports for one of my switch :

INFOURL /cacti/graph.php?rra_id=all&local_graph_id=3839
OVERLIBGRAPH /cacti/graph_image.php?local_graph_id=3839&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
ICON images/fibre2_{node:this:inscaletag}.png
TARGET gauge:/var/www/html/cacti/rra/ra_int_status_3858.rrd:int_status:-
USESCALE ifstatus in
POSITION 290 503

INFOURL /cacti/graph.php?rra_id=all&local_graph_id=3840
OVERLIBGRAPH /cacti/graph_image.php?local_graph_id=3840rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
ICON images/fibre2_{node:this:inscaletag}.png
TARGET gauge:/var/www/html/cacti/rra/ra_int_status_3859.rrd:int_status:-
USESCALE ifstatus in
POSITION 290 533

You also need some png's and put them in images/, you'll have one png for every port status(up, down). When weathermap runs, it gets the value from cacti and will graph nicely a "fibre2_UP.png" with green color if the port is UP and "fibre2_DO.png" with red color if the port is down. Every change in port will be automatically modified in Weathermap also.

You should get something like this.

PS : Check the Weathermap thread, there's huge infos there and Howie always responds :). Izorka has some amazing maps(the best imo).
cisco weathermap ports.jpg
cisco weathermap ports.jpg (158.51 KiB) Viewed 2909 times

Posts: 16
Joined: Mon Sep 30, 2013 12:24 am

Re: Port Monitor

#3 Post by Akven » Wed Dec 13, 2017 1:14 am

Ok, I'll try this)

But I'm not really good at scripting, so it's a hand-made job anyway(
The problem is - we don't need all the ports from the switch. Usually it's 1-2 ports from 1 switch. So 1000 ports is about 1000 switches on the map.
It's a client service monitoring, but we don't need to monitor the client side (ping or something simple) - we need to monitor our side (port status and traffic on the map) - and it is frustrating.

I wonder if anyone ever encountered with something alike.
And the most needed feature - it should be automated - so I don't need to manage the map side - only cacti database (adding switches and ports and grouping them on tree).

I found a good picture example of what I intended to find - but it is some freelance program with no demo. Just a concept.
2167756.jpg (68.47 KiB) Viewed 1689 times

Post Reply