I have plugin reportit that need "ifspeed" option in some formulas, but speed is not shaped on interface that I m pooling so instead of 50M he gives me 100M i.e interface maximum.
My question is; how can I hard code it "ifspeed" on every interface. Please be detail as much as you can or link "howto", i tried to google it but - no luck.
Ty, regards
How can I hard code it "ifspeed" (reportit)
Moderators: Developers, Moderators
-
- Cacti User
- Posts: 54
- Joined: Tue Dec 22, 2009 1:54 am
How can I hard code it "ifspeed" (reportit)
Last edited by White Horse on Mon Apr 05, 2010 5:34 am, edited 1 time in total.
-
- Cacti User
- Posts: 54
- Joined: Tue Dec 22, 2009 1:54 am
I made report of all my links using Cacti plugin "reportit", in one forumula i use maxValue - that says that he will take "ifspeed" from interface as my max alow bandwidth, and the value is correct for most of the interfaces but for some it is wrong.
For example, I have 1Gig interface that is shaped on on provider side by 50M, but "ifspeed" says it is 1Gig and he is right because no shape-ing or QOS is put on my side. Also on subintefaces he takes speed of physical interface, so that messes up my output info.
I dont thing i need rrd files ds-maximum, I just need to manually enter interface speed (max allowed bandwidth).
I m new to cacti so bear with me, i think Reportit uses interface statistic query to find out "ifspeed" so I maybe I can manualy change "ifspeed" there for problematic interfaces? If so than how?
I dont have wlan, all interfaces are 1G or 100M that are shaped by qos or bandwidth command on cisco routers, but sadly not on all so there rises my problem.
For example, I have 1Gig interface that is shaped on on provider side by 50M, but "ifspeed" says it is 1Gig and he is right because no shape-ing or QOS is put on my side. Also on subintefaces he takes speed of physical interface, so that messes up my output info.
I dont thing i need rrd files ds-maximum, I just need to manually enter interface speed (max allowed bandwidth).
I m new to cacti so bear with me, i think Reportit uses interface statistic query to find out "ifspeed" so I maybe I can manualy change "ifspeed" there for problematic interfaces? If so than how?
I dont have wlan, all interfaces are 1G or 100M that are shaped by qos or bandwidth command on cisco routers, but sadly not on all so there rises my problem.
Last edited by White Horse on Sun Apr 04, 2010 6:25 am, edited 1 time in total.
-
- Cacti User
- Posts: 54
- Joined: Tue Dec 22, 2009 1:54 am
EDIT; admins, please move this to Plugin general section
I found solution that is perfect for me, it is not hard coding "ifspeed" but just telling Reportit that takes "maximum value" of DS insted of "ifspeed".
Great help was PHP edit of user BRYLANT that he edited funct_runtime.php and runtime.php so that do the same as mention above but for him only when "ifspeed"=0
For me it is just simple "ifspeed"="maxRRDValue";
In lib_int/funct_runtime.php update code at line 45
and in runtime.php add this at line 437
and update this in line 627
.[/quote]
Also don't forget to edit Interface - Traffic data template. Just check "Maximum Value ** Use Per-Data Source Value (Ignore this Value)" on Inbound traffic and Outbound if necessary.
I found solution that is perfect for me, it is not hard coding "ifspeed" but just telling Reportit that takes "maximum value" of DS insted of "ifspeed".
Great help was PHP edit of user BRYLANT that he edited funct_runtime.php and runtime.php so that do the same as mention above but for him only when "ifspeed"=0
For me it is just simple "ifspeed"="maxRRDValue";
In lib_int/funct_runtime.php update code at line 45
Code: Select all
$sql = "SELECT d.rrd_maximum as maxRRD, c.field_value as maxValue, a.*
FROM reportit_data_items as a
LEFT JOIN data_local as b
ON (b.id=a.id)
LEFT JOIN host_snmp_cache as c
on (c.host_id=b.host_id AND
c.snmp_index=b.snmp_index AND
c.snmp_query_id=b.snmp_query_id AND
c.field_name='ifSpeed')
LEFT JOIN data_template_rrd as d
on (d.local_data_id=a.id AND
d.data_source_name LIKE 'traffic_in')
WHERE a.report_id = $report_id
ORDER BY a.id";
Code: Select all
$maxRRDValue = $report_definitions['data_items'][$i]['maxRRD'];
Code: Select all
//----- Update variables and create calculating parameters -----
//if($maxValue !== NULL) {
// if($maxValue > 0 & $maxValue < 4294967295)
//$variables['maxValue'] = $maxValue;
//elseif($maxValue == 4294967295 & $maxHighValue !== Null)
// $variables['maxValue'] = $maxHighValue*1000000;
//elseif($maxValue == 0 & $maxRRDValue != 0)
$variables['maxValue'] = $maxRRDValue;
//else
//$variables['maxValue'] = $maxValue;
//}else{
//$variables['maxValue'] = $maximum;
//}
Also don't forget to edit Interface - Traffic data template. Just check "Maximum Value ** Use Per-Data Source Value (Ignore this Value)" on Inbound traffic and Outbound if necessary.
Who is online
Users browsing this forum: No registered users and 1 guest