When you say 'calculate availability' do you mean as a percentage, or just the current state. The current state can be done using the SNMP DS plugin. You could use Cacti rrd files too, if you already graph ifOperStatus.
Here's part of my config for doing this...
Code: Select all
SET community public
SCALE updown 0 0 255 255 0
SCALE updown 2 2 255 0 0
SCALE updown 1 1 0 255 0
SCALE updown 3 3 192 192 192
SCALE updown 4 4 0 0 192
SCALE updown 6 6 0 0 192
NODE DEFAULT
LABELOFFSET E
LABELOUTLINECOLOR none
LABELBGCOLOR none
LABELFONTCOLOR 255 255 255
LABELFONT 80
NODE port
USESCALE updown in
ZORDER 300
LABELFONT 24
LABELFONTCOLOR contrast
OVERLIBWIDTH 403
OVERLIBHEIGHT 165
TARGET snmp:{map:community}:{node:this:ip}:.1.3.6.1.2.1.2.2.1.8.{node:this:interface}:-
INFOURL /cacti/graph.php?action=view&rra_id=all&local_graph_id={node:this:graph_id}
OVERLIBGRAPH /cacti/graph_image.php?rra_id=0&graph_height=100&graph_widt
h=300&graph_nolegend=true&local_graph_id={node:this:graph_id}
NODE switch1a
LABEL 1A
LABELOFFSET E
POSITION 320 120
ICON 600 400 images/C3560.png
ZORDER 200
NODE switch1a_p01
TEMPLATE port
SET interface 10101
SET ip 10.225.6.10
SET ifname GigabitEthernet0/1
SET host_id 154
SET graph_id 2165
SET data_id 2465
POSITION switch1a -94 -5
LABEL 01
NODE switch1a_p02
TEMPLATE port
SET interface 10102
SET ip 10.225.6.10
SET ifname GigabitEthernet0/2
SET host_id 154
SET graph_id 2166
SET data_id 2466
POSITION switch1a -94 12
LABEL 02
Cisco 3750s use strange interface indexes (starting at 10100 for the first port), but the basic idea is the same for anything. This will poll the SNMP status directly from the switch.
You could do the same with rrd files though - it's just taking a value and colouring a node.
I actually use a perl script to generate all the ports - it's pretty boring to do this for a lot of switches
