|
|
| Author |
Message |
wwwdrich Cacti User
Joined: 03 Feb 2005 Posts: 54 Location: San Jose, CA
|
Posted: Mon Apr 07, 2008 5:01 pm Post subject: |
|
|
Here's a quick patch to turn the auto-width patch into a range and get rid of the error message above. This isn't the best way to do this, but it works. (ignore the overwrite_targets line, I was going to look at adding some code to auto-overwrite the targets, but haven't really thought about that yet).
| Code: |
--- /home/drich/cacti_integratephp_110.txt 2008-04-07 14:22:09.942962000 -0700
+++ random-bits/cacti-integrate.php 2008-04-07 14:58:32.000000000 -0700
@@ -1,25 +1,31 @@
<?php
-$mapfile = "configs/int.conf";
-$outputmapfile = "output.conf";
+$mapfile = "configs/gld-desktop.conf.orig";
+$outputmapfile = "configs/gld-desktop.conf";
# defaults. Should be overwritten by the cacti config.
-$cacti_base = '../../';
-$cacti_url = '/';
+$cacti_base = '/var/www/html/cacti/';
+$cacti_url = '/cacti/';
include_once 'editor-config.php';
# set this to 1 to adjust the width of links according to speed
$map_widths = 1;
+# set this to 1 to overwrite existing targets
+$overwrite_targets = 1;
+
# adjust width of link based on bandwidth.
# NOTE: These ARE NOT bands - the value has to be EXACTLY the one in the table. $width_map = array(
'1000000'=>'1', # 1meg
'2000000'=>'1', # 2meg
'10000000'=>'2', # 10meg
+ '99999999'=>'2', # 10meg-100M
'100000000'=>'4', # 100meg
+ '999999999'=>'4', # 100meg-1G
'1000000000'=>'6', # 1gig
+ '9999999999'=>'6', # 1gig-10G
'10000000000'=>'8' # 10gig
);
@@ -218,10 +224,14 @@
if($map_widths)
{
- if($width_map{$total_speed})
+ foreach($width_map as $map_speed => $map_width)
+ {
+ if($total_speed < $map_speed)
{
- $map->links[$name]->width = $width_map{$total_speed};
- print " WIDTH ".$width_map{$total_speed}."\n";
+ $map->links[$name]->width = $map_width;
+ print " WIDTH ".$map_width."\n";
+ continue 2;
+ }
}
}
|
Oh, and I realized what my comment problem is -- I have the comments set to pull the data directly from in_comment and out_comment, i.e. INCOMMENT {link:this:in_interface}. What's the chance of your code building the comments (with abbreviations ) if they don't already exist, and/or creating new values I can use like abbrev_in_interface? |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 1969 Location: United Kingdom
|
Posted: Mon Apr 07, 2008 5:09 pm Post subject: |
|
|
| wwwdrich wrote: | Ok, you dont' expect the value in the MIBs to actually be correct, now do you?! I'll have to query our Foundry devices to see what they are really reporting. Our MG8s report the correct numbers, all of the other ones are the 32-bit values. I supposed if you're querying with SNMP v2 there is no reason they couldn't return the full 64-bit value.
|
But for both traffic counters and this thing the 64-bit or highspeed version is an entirely different OID. That's why I was puzzled. |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 1969 Location: United Kingdom
|
Posted: Mon Apr 07, 2008 5:23 pm Post subject: |
|
|
| wwwdrich wrote: | Here's a quick patch to turn the auto-width patch into a range and get rid of the error message above. This isn't the best way to do this, but it works. (ignore the overwrite_targets line, I was going to look at adding some code to auto-overwrite the targets, but haven't really thought about that yet).
|
I was going to suggest something similar actually. In 0.96 there will be something different again - templates. You will be able to say 'copy settings from *that* link' instead of DEFAULT, so you can have a template link for 100M, 1G etc with completely different styles. Same for nodes, so you can have a 'router' template and a 'switch' template with different icons, different labelling etc.
| Quote: |
Oh, and I realized what my comment problem is -- I have the comments set to pull the data directly from in_comment and out_comment, i.e. INCOMMENT {link:this:in_interface}. What's the chance of your code building the comments (with abbreviations ) if they don't already exist, and/or creating new values I can use like abbrev_in_interface? |
How about if I store up all those ifAlias, ifName and ifDescr results and put them into SETs, like I do for the node? On Cisco, one of those is Gi0/34, one is GigabitEthernet0/34 and the other other is server22_primary (i.e. your description). It'd have to be a string of each of those, separated by spaces or something, where there are multiple links. Does at least one of them show the right thing on Foundry?
That would be the most flexible way, if so. Much like Cacti's graph title selection thing.
In fact if any of those *do* show the right thing, then you can use that name in the in_interface string in the first place too - the script looks in all 3 OIDs.
Think yourself lucky though, on a Nortel Baystack, the interface description is: "Nortel Networks BayStack 450_201 Ethernet Switch Module - Unit 2 Port 8" and it lets you put in a friendly name which then appears absolutely nowhere. |
|
| Back to top |
|
 |
wwwdrich Cacti User
Joined: 03 Feb 2005 Posts: 54 Location: San Jose, CA
|
Posted: Thu Apr 10, 2008 2:18 pm Post subject: |
|
|
| Howie wrote: |
| wwwdrich wrote: |
Oh, and I realized what my comment problem is -- I have the comments set to pull the data directly from in_comment and out_comment, i.e. INCOMMENT {link:this:in_interface}. What is the chance of your code building the comments (with abbreviations ) if they do not already exist, and/or creating new values I can use like abbrev_in_interface? |
How about if I store up all those ifAlias, ifName and ifDescr results and put them into SETs, like I do for the node? ... Does at least one of them show the right thing on Foundry? |
Of course not! I just checked, IfAlias is what we put in, ifDescr has the long name, and ifName has a "short" name. Personally, I have a hard time considering "ethernet" to be a short version of "GigabitEthernet", but apparently Foundry thinks it is.
| Howie wrote: |
Think yourself lucky though, on a Nortel Baystack, the interface description is: "Nortel Networks BayStack 450_201 Ethernet Switch Module - Unit 2 Port 8" and it lets you put in a friendly name which then appears absolutely nowhere. |
Eewwww. I will add that to my list of "why not to buy Nortel". Admittedly, my list of "why not to buy Foundry" is as long as my arm and we keep purchasing equipment from them, so I am not sure how useful that is....  |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|