Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Interface errors report

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (MAC Track)
Author Message
mseigafuse



Joined: 17 Sep 2004
Posts: 5

PostPosted: Tue Nov 27, 2007 1:18 pm    Post subject: Interface errors report Reply with quote

While troubleshooting a problem with my mactrack install (just a device detection issue easily resolved) I noticed that there were fields for errors in the interfaces table. It occurred to me that this could be useful to generate reports of interface errors. Having the ability to look one place for most of the daily operational kinds of checks (in Cacti) would be nice. I took at look at the code and decided to have a go at it (see screenshot).

One thing I thought I'd like to take care of is to have a way to reset the error counters in the interface table if the counters on the device reset to zero or lower than what is in the table. I am considering modifying this section of mactrack_functions.php (line 462) to handle this:

/* see if error's or discards have been increating */
if (!isset($db_interface[$ifIndex]["ifInErrors"])) {
$int_errors_present = FALSE;
}else if (!isset($ifInErrors[$ifIndex])) {
$int_errors_present = FALSE;
}else if (!isset($ifOutErrors[$ifIndex])) {
$int_errors_present = FALSE;
}else if (($ifInErrors[$ifIndex] <> $db_interface[$ifIndex]["ifInErrors"]) ||
($ifOutErrors[$ifIndex] <> $db_interface[$ifIndex]["ifOutErrors"])) {
$int_errors_present = TRUE;
}else{
$int_errors_present = FALSE;
}

if (!isset($db_interface[$ifIndex]["ifInDiscards"])) {
$int_errors_present = FALSE;
}else if (!isset($ifInDiscards[$ifIndex])) {
$int_discards_present = FALSE;
}else if (!isset($ifOutDiscards[$ifIndex])) {
$int_discards_present = FALSE;
}else if (($ifInDiscards[$ifIndex] <> $db_interface[$ifIndex]["ifInDiscards"]) ||
($ifOutDiscards[$ifIndex] <> $db_interface[$ifIndex]["ifOutDiscards"])) {
$int_discards_present = TRUE;
}else{
$int_discards_present = FALSE;
}

Can you think of any reason I could not reset the values by changing the logic to detect when the device counters are lower than what is in the table?

I modified mactrack_view.php and created a new file called inc_mactrack_view_error_filter_table.php to implement this report. I basically just took sections of your existing code and modified it to generate the error report. If there is any interest in this I'll be happy to provide the modified files.

Mike



mactrack interface error report.jpg
 Description:
Interface Errors report screenshot
 Filesize:  132.78 KB
 Viewed:  811 Time(s)

mactrack interface error report.jpg


Back to top
mseigafuse



Joined: 17 Sep 2004
Posts: 5

PostPosted: Fri Nov 30, 2007 12:46 pm    Post subject: Answer my own (stupid) question Reply with quote

After a bit more review of the code and some reading I realize it was a stupid question. Never mind on that.

But, in case anyone else is interested the files to add the report to MAC Track 1.1 are in the attached zip file. I did modify mactrack_view.php in order to implement this.

Mike



mactrack_int_error_rpt.zip
 Description:

Download
 Filename:  mactrack_int_error_rpt.zip
 Filesize:  13.58 KB
 Downloaded:  61 Time(s)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (MAC Track) All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group