I wrote a small script which uses CDP to discover other equipment in the network. It's not bug-proof and it might not work for you, but it works for me. It creates a good startingpoint for a weathermap.conf file.
Run the script as
Code: Select all
./cdp_traversal.pl 192.168.0.254 > weathermap.conf
Warning: It can only fill in the TARGETs correctly if you have used IP-numbers when you created the device in cacti.
It only works with equipment that has CDP (Cisco Detection Protocol??) enabled. I have only tested it with Cisco equipment.
The generated weathermap.conf file will need to be edited.
I also had to edit the weathermap script a bit, here is the diff
Code: Select all
--- weathermap~ 2005-04-12 16:11:29.000000000 +0200
+++ weathermap 2005-04-12 16:18:23.000000000 +0200
@@ -396,7 +396,7 @@
print "found HEIGHT: $HEIGHT\n" if($DEBUG);
}
}
- if(/^\s*NODE\s+(\w+)/i){
+ if(/^\s*NODE\s+(\S+)$/i){
$node=$1;
$last_item = "node";
print "found NODE: $node\n" if($DEBUG);
@@ -406,7 +406,7 @@
$ypos{$node}=$2;
print "found NODE: $node XPOS: $xpos{$node} YPOS: $xpos{$node}\n" if($DEBUG);
}
- if(/^\s*LABEL\s+(\S+)/i){
+ if(/^\s*LABEL\s+(.+)$/i){
$label{$node}=$1;
print "found NODE: $node LABEL: $label{$node}\n" if($DEBUG);
}