Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon Mar 25, 2019 12:54 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Analyzing Poller Performance from DEBUG Log
PostPosted: Wed Mar 08, 2006 2:28 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22376
Location: Muenster, Germany
Suppose you're running into poller timing problems. You will want to track this down, perhaps to a single host. Information can be taken from log/cacti.log when running in DEBUG mode. But for more than a few hosts, this will be tedious.
So I started writing some perl code to parse cacti.log. But then I changed my mind and I re-wrote this using php. The code is mainly based on host.php. For embedding this into cacti, I tried the plugin-arch of cigamit, but to my shame I failed (perhaps I made too many patches already? Or the svn code is not compatible to the latest plugin arch?). So I made another patch.

Installing
The code is mainly one single module called poller-perf.php to be put into main cacti directory. Apart from this, there are only two required changes:
include/config_arrays.php:
Code:
$user_auth_realm_filenames: add a line reading
"poller-perf.php" => 8
at the end of the array

lib/functions.php:
Code:
function draw_navigation_text()
array  $nav: add a line reading
"poller-perf.php:" => array("title" => "Poller Performance", "mapping" => "index.php:", "url" => "poller-perf.php", "level" => "1"),
at the end of the array


You may as well use the attached patch. Download this to cacti main directory and install running
Code:
patch -p1 < poller-perf.patch
This patch is based on current 0.8.6h svn branch, so it may fail on other versions.

Usage
Please clear your log/cacti.log file to reduce runtime. This is strongly recommended. Then switch to DEBUG mode (See: Settings -> Logging Level) and wait for at least one polling cycle. Switch over to your browser and enter
Code:
http://localhost/cacti/poller-perf.php
assuming http://localhost/cacti/ points to your current cacti directory. Depending on the size of log/cacti.log it may take a little time for the display to come up.
General usage is mostly like the Devices display. Please find a screenshot attached.
Poller Runs including Statistics
This many poller runs with timing data were found in log/cacti.log. Waiting for another polling cycle in DEBUG mode will add 1 to that number
Total Runs
This many total poller runs were found. If this exceeds the above value, there was output from poller runs not using DEBUG mode. These runs are skipped
Column Descriptions
Last Poller Start
Timestamp of the first record belonging to that host taken from last poller run
Last Poller End
Timestamp of the last record belonging to that host taken from last poller run
Both timestamp use "seconds" resolution only. So data is exact only to that level of accuracy. To avoid meaningless values for the following calculations, the time difference is caclculated using (end - start) + 0.5. Please take this into account when analyzing data.
#DS Total
Number of all datasources for that host (excluding ERROR/WARNING messages) for ALL poller runs
Duration Total
Sum of all durations calculated using (end - start) + 0.5
#DS per run
"#DS Total" divided by number of "Poller Runs including Statistics"
Duration per run
"Duration Total" divided by number of "Poller Runs including Statistics"
Duration per DS
"Duration Total" divided by number of "#DS Total"

Hope this helps discovering unresponsive hosts or performance problems during data gathering.

AS ALWAYS: Use this at your own risk

happy cactiing
Reinhard


Attachments:
File comment: Output of poller-perf.php
poller-perf-1.jpg
poller-perf-1.jpg [ 70.6 KiB | Viewed 29938 times ]
File comment: The patch
Install using
patch -p1 &lt; poller-php.patch
(option: minus p one)

poller-perf.patch [10.9 KiB]
Downloaded 1261 times
File comment: The poller-perf.php code
Use this, if patch fails but remember to change include/config_arrays.php and
lib/functions.php
as described in this topic

poller-perf.php.gz [3.03 KiB]
Downloaded 845 times

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository
Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 2:45 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5290
Location: United Kingdom
I really liked this! :-)

Here's a zip with the exact(*) same code packaged up as a Plugin Architecture plugin, just for those that prefer not to patch Cacti itself.

Unpack it into your plugins folder, then add a
Code:
$plugins[] = 'pollperf';

line below your other plugins.


(*) I needed to add a chdir() at the top to make it work in a subdirectory, but that's it.


Attachments:
pollperf-0.1.zip [3.95 KiB]
Downloaded 1324 times

_________________
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 3:25 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22376
Location: Muenster, Germany
Wow, thank you Howie for your assistance. I suppose it is time (even for me) to dig through that plugin arch.
But I used to run the latest svn code and I haven't get this working til now. Perhaps I'll try to jump into current 0.9.0 trunk to learn the new plungin arch from scratch?
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 12, 2006 2:52 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22376
Location: Muenster, Germany
Howie,

again many thanks for your assistance. I'm now running a standard cacti-0.8.6h in parallel with current svn and was able to implement the plugin arch without any problems (great work, Jimmy!).
So I was able to verify the plugin and posted this as a beta plugin to http://cactiusers.org/forums/viewtopic.php?p=946#946

I recommend using this plugin as it is a more convenient way to implement Add-Ons to cacti.

Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 12, 2006 3:01 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5290
Location: United Kingdom
lvm wrote:
Howie,

again many thanks for your assistance. I'm now running a standard cacti-0.8.6h in parallel with current svn and was able to implement the plugin arch without any problems (great work, Jimmy!).


No problem :-) Glad you got it working. All the better to improve Cacti... now I should get my own plugin finished. :roll:

_________________
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 12, 2006 4:16 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22376
Location: Muenster, Germany
Howie wrote:
No problem :-) Glad you got it working. All the better to improve Cacti... now I should get my own plugin finished. :roll:
Yes, that would be a good one. Had already a try with your weathermap. But unfortunately, our redundancy concept is somewhat complicated. So I'm at a loss with those "straight" lines between targets ...
But don't hesitate. Your work is greatly appreciated by many users :P :D
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 12, 2006 4:57 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5290
Location: United Kingdom
lvm wrote:
Howie wrote:
No problem :-) Glad you got it working. All the better to improve Cacti... now I should get my own plugin finished. :roll:
Yes, that would be a good one. Had already a try with your weathermap. But unfortunately, our redundancy concept is somewhat complicated. So I'm at a loss with those "straight" lines between targets ...
But don't hesitate. Your work is greatly appreciated by many users :P :D
Reinhard


Ah - then 0.8 is for you! :-) Curved links, and aggregate links are among the new features (along with proper Cacti integration of course). It should be done in the next week or so.

_________________
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 16, 2006 2:03 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22376
Location: Muenster, Germany
You're going to make my feet tremble :lol: :o :D
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 13, 2006 8:11 am 
Offline

Joined: Wed Sep 13, 2006 6:23 am
Posts: 3
Hi... i have install this plugin... and until have cmd.php running... its works so fine... But, now... i work with cactid... and when i execute the poller performance, its change my poller metod for cmd.php....

Its Normals? I reset the poller metod and back to normal with cactid.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 9:56 am 
Offline
User avatar

Joined: Fri Mar 24, 2006 7:56 am
Posts: 9
Location: Ireland
Installed pollerperf from howie's Cacti Plugin Arch version. It didn't include a host.php.
When clicking on a host name in the poller performance page (under utilities), it tries to go to
[cactihost]/cacti/plugins/pollperf/host.php?action=edit&id=xyz
instead of what I assume to be correct <?>
[cactihost]/cacti/host.php?action=edit&id=xyz

HostInfo:
Quote:
Cacti Version - 0.8.6h
Plugin Architecture - 1.0
Poller Type - Cactid v0.8.6f
Server Info - Linux 2.6.15-26-386
Web Server - Apache/2.0.55 (Ubuntu) PHP/5.1.2
PHP - 5.1.2
PHP Extensions - xmlwriter, libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, standard, SimpleXML, sockets, soap, SPL, shmop, session, Reflection, posix, mime_magic, mbstring, iconv, hash, gettext, ftp, filepro, exif, dom, dba, date, ctype, calendar, bz2, bcmath, zlib, pcre, openssl, xmlreader, apache2handler, mysql, snmp, mysqli, gd
MySQL - 5.0.22-Debian_0ubuntu6.06.2-log
RRDTool - 1.2.11
SNMP - 5.2.1.2
Plugins
    Read-only Devices Tab (devices - v0.4)
    Network Discovery (discovery - v0.6)
    Host Info (hostinfo - v0.1)
    Simple Links page (links - v0.3)
    Device Monitoring (monitor - v0.7)
    Poller Performance Report (pollperf - v0.1)
    Thresholds (thold - v0.3.0)
    Network Tools (tools - v0.2)
    Update Checker (update - v0.3)
    PHP Network Weathermap (weathermap - v0.82)


/usr/share/cacti/site/include/config.php:
$plugins[] = 'devices';
$plugins[] = 'discovery';
//$plugins[] = 'flowview';
$plugins[] = 'hostinfo';
$plugins[] = 'links';
//$plugins[] = 'mactrack';
//$plugins[] = 'manage';
$plugins[] = 'monitor';
$plugins[] = 'pollperf';
//$plugins[] = 'rrdclean';
$plugins[] = 'thold';
$plugins[] = 'tools';
$plugins[] = 'update';
//$plugins[] = 'uptime'; Deprecated
$plugins[] = 'weathermap';
//$plugins[] = '';


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 20, 2006 6:54 am 
Offline
Cacti Guru User
User avatar

Joined: Fri Sep 19, 2003 8:36 am
Posts: 2326
Location: Sophia-Antipolis, France
SyxPak wrote:
Installed pollerperf from howie's Cacti Plugin Arch version. It didn't include a host.php.
When clicking on a host name in the poller performance page (under utilities), it tries to go to
[cactihost]/cacti/plugins/pollperf/host.php?action=edit&id=xyz
instead of what I assume to be correct <?>
[cactihost]/cacti/host.php?action=edit&id=xyz

Hi

I have the same problem. A temporary fix is to edit poller-perf.php line 179 :
Code:
<a class="linkEditMain" href="/cacti/host.php?action=edit&id=<?php print $host["id"];?>"><?php print $host["description"];?></a>

When you install the plugin architecture, a URL_PATH is defined. I've tried to use it in poller-perf.php, but failed :oops:

_________________

HOWTOs :
Templates :


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 20, 2006 11:34 am 
Offline
Cacti User
User avatar

Joined: Wed Nov 09, 2005 8:35 am
Posts: 240
Location: Timisoara, Romania
the plugin works great, and modified the poller-perf.php to work the edit host link :) 10q :lol:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 28, 2006 2:49 am 
Offline
Cacti User
User avatar

Joined: Wed Nov 09, 2005 8:35 am
Posts: 240
Location: Timisoara, Romania
obviously i have a problem :( for some time, the pollerperf looks like this :(, what does this mean ?


Attachments:
pollerperf.PNG
pollerperf.PNG [ 12.37 KiB | Viewed 27859 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 28, 2006 2:56 am 
Offline
Cacti Guru User
User avatar

Joined: Fri Sep 19, 2003 8:36 am
Posts: 2326
Location: Sophia-Antipolis, France
Hi

do you use DEBUG as logging level ?

_________________

HOWTOs :
Templates :


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 28, 2006 3:11 am 
Offline
Cacti User
User avatar

Joined: Wed Nov 09, 2005 8:35 am
Posts: 240
Location: Timisoara, Romania
nope, but now i did, for what should i look, there are a lot of lines :)


Last edited by timi on Tue Nov 28, 2006 3:14 am, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group