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    


Analyzing Poller Performance from DEBUG Log
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map)
Author Message
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12275
Location: Muenster, Germany

PostPosted: Wed Mar 08, 2006 2:28 pm    Post subject: Analyzing Poller Performance from DEBUG Log Reply with quote

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



poller-perf-1.jpg
 Description:
Output of poller-perf.php
 Filesize:  70.6 KB
 Viewed:  10569 Time(s)

poller-perf-1.jpg



poller-perf.patch
 Description:
The patch
Install using
patch -p1 < poller-php.patch
(option: minus p one)

Download
 Filename:  poller-perf.patch
 Filesize:  10.9 KB
 Downloaded:  570 Time(s)


poller-perf.php.gz
 Description:
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

Download
 Filename:  poller-perf.php.gz
 Filesize:  3.03 KB
 Downloaded:  319 Time(s)

Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2162
Location: United Kingdom

PostPosted: Sat Mar 11, 2006 2:45 pm    Post subject: Reply with quote

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.



pollperf-0.1.zip
 Description:

Download
 Filename:  pollperf-0.1.zip
 Filesize:  3.95 KB
 Downloaded:  577 Time(s)

Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12275
Location: Muenster, Germany

PostPosted: Sat Mar 11, 2006 3:25 pm    Post subject: Reply with quote

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
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12275
Location: Muenster, Germany

PostPosted: Sun Mar 12, 2006 2:52 pm    Post subject: Reply with quote

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
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2162
Location: United Kingdom

PostPosted: Sun Mar 12, 2006 3:01 pm    Post subject: Reply with quote

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.
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12275
Location: Muenster, Germany

PostPosted: Sun Mar 12, 2006 4:16 pm    Post subject: Reply with quote

Howie wrote:
No problem Glad you got it working. All the better to improve Cacti... now I should get my own plugin finished.
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
Reinhard
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2162
Location: United Kingdom

PostPosted: Sun Mar 12, 2006 4:57 pm    Post subject: Reply with quote

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.
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
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.
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12275
Location: Muenster, Germany

PostPosted: Thu Mar 16, 2006 2:03 pm    Post subject: Reply with quote

You're going to make my feet tremble
Reinhard
Back to top
sandman



Joined: 13 Sep 2006
Posts: 3

PostPosted: Wed Sep 13, 2006 8:11 am    Post subject: Reply with quote

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.
Back to top
SyxPak



Joined: 24 Mar 2006
Posts: 9
Location: Ireland

PostPosted: Thu Oct 26, 2006 9:56 am    Post subject: Reply with quote

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[] = '';
Back to top
fmangeant
Cacti Guru User


Joined: 19 Sep 2003
Posts: 2325
Location: Sophia-Antipolis, France

PostPosted: Mon Nov 20, 2006 6:54 am    Post subject: Reply with quote

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
Back to top
timi
Cacti User


Joined: 09 Nov 2005
Posts: 129
Location: Timisoara, Romania

PostPosted: Mon Nov 20, 2006 11:34 am    Post subject: Reply with quote

the plugin works great, and modified the poller-perf.php to work the edit host link 10q
Back to top
timi
Cacti User


Joined: 09 Nov 2005
Posts: 129
Location: Timisoara, Romania

PostPosted: Tue Nov 28, 2006 2:49 am    Post subject: Reply with quote

obviously i have a problem for some time, the pollerperf looks like this , what does this mean ?


pollerperf.PNG
 Description:
 Filesize:  12.37 KB
 Viewed:  8490 Time(s)

pollerperf.PNG


Back to top
fmangeant
Cacti Guru User


Joined: 19 Sep 2003
Posts: 2325
Location: Sophia-Antipolis, France

PostPosted: Tue Nov 28, 2006 2:56 am    Post subject: Reply with quote

Hi

do you use DEBUG as logging level ?
Back to top
timi
Cacti User


Joined: 09 Nov 2005
Posts: 129
Location: Timisoara, Romania

PostPosted: Tue Nov 28, 2006 3:11 am    Post subject: Reply with quote

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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map) All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group