Graph amount of time needed to poll individual hosts

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
Hanseat
Posts: 17
Joined: Thu Sep 27, 2012 5:24 am

Graph amount of time needed to poll individual hosts

Post by Hanseat »

Hi there,

i don´t know if it´s out there (and, yes, i looked for an extensive amount of time), but i wonder
if anyone was able to graph the time poller time for individual hosts.
Meaning: each hosts takes some seconds to get polled by either cmd.php or spine (spine > cmd.php!).
I can see the amount of time a host takes when i set logging detail to Medium, with an output like

Code: Select all

"09/27/2012 04:39:05 PM - SPINE: Poller[0] Host[689] TH[1] Total Time: 0.22 Seconds"
.

Now, i´d like to have a "poll-time" graph for each Host i monitor. Short of parsing the cacti.log file
for each host and do some regex-fu, how would i go about that? Or more importantly: has this been done before?

Why would i want that: well, with a network where a lot of hosts can only be reached across WAN and a lot
of custom scripts that might perfom slow, i´d like to know which Host does really bad and keeps "gapping" up
my graphs.

cheers,
Hans
Hanseat
Posts: 17
Joined: Thu Sep 27, 2012 5:24 am

Re: Graph amount of time needed to poll individual hosts

Post by Hanseat »

Since i´m pretty impatient, this is what i came up with (far from neat, but works for me) and I will post templates and the likes next week:

Code: Select all

#!/bin/sh
tac $1 | grep -E -o -m 1 "(Host\[$2\] TH... Total Time:.*)[0-9]" | grep -P -o "(?<=Time:).*" | tr -d ' '
$1 = Path to logfile
$2 = ID of Host

Medium logging needs to be enabled, i advise to adjust your logrotate accordingly.

Started with localhost (file attached), but works for any host that is being polled ofc.
Attachments
localhost-pollertime.png
localhost-pollertime.png (16.75 KiB) Viewed 830 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests