Interface errors report

Support questions about the MAC Track plugin

Moderators: Developers, Moderators

Post Reply
mseigafuse
Posts: 5
Joined: Fri Sep 17, 2004 3:01 pm

Interface errors report

Post by mseigafuse »

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
Attachments
Interface Errors report screenshot
Interface Errors report screenshot
mactrack interface error report.jpg (132.78 KiB) Viewed 3632 times
mseigafuse
Posts: 5
Joined: Fri Sep 17, 2004 3:01 pm

Answer my own (stupid) question

Post by mseigafuse »

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
Attachments
mactrack_int_error_rpt.zip
(13.58 KiB) Downloaded 297 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Nice contrib. I will be doing this just a little different. I hope you like MacTrack 2.0 once it's released. :)

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests