Xymon Mailing List Archive search

custom rrd data

10 messages in this thread

list Ivan Verbeeck · Tue, 26 Apr 2005 15:21:14 +0200 ·
Hello,

Question about the custom rrd data :

I configured the hobbit server (4.0.2 installed from the .deb release on
a debian linux) for generating a custom rrd.
- wrote a simple script (tested with perl and shell script)
- added the --extra-script and the --extra-test in the launch file
- added the name of the test in the config file
- added a section in hobbitgraph.cfg
- restarted hobbit

The web page directly shows a link to an rrd, but the rrd file isn't
created. After a few hours(!) the rrd is generated and then sometimes
(random once every few hours/days) data is inserted.
The script runs every time when data is received (5 minutes), get the
correct data and print the correct output.
I now changed the script to update the rrd itselfs(see bottom of the
mail), but that isn't offcourse the right solution.
Anyone an idee what can be wrong?

Kind regards,
Ivan Verbeeck


#!/usr/bin/perl
use RRDs;
#
# Input parameters: hostname, testname, and filename (messagefile)
#

$hostname = $ARGV[0];
$testname = $ARGV[1];
$filename = $ARGV[2];

#
# check and process "usercount"
#

if ($testname eq "usercount") {
  open(DATA, $filename) || die("Could not open messagefile!");
  while ($line = <DATA>) {
    if ($line =~ /gebruikers/) {
      @words = split(/:/, $line);
      $aantal = substr($words[1],1,2);
    }
  }
  close (DATA);

#
# update the rrd instead of printing to hobbit :-(
#

#  print "DS:users:GAUGE:600:0:U\n";
#  print "usercount.rrd\n";
#  print $aantal,"\n";

  $rrd = $ENV{"BBRRDS"}."/$hostname/$testname.rrd";
  if (! -e $rrd) {
    my $interval = 5;
    my $time = time;
    my @args = ($rrd, '-b', $time-10, '-s', int($interval * 60),
                "DS:users:GAUGE:600:U:U",
                "RRA:AVERAGE:0.5:1:576",
                "RRA:AVERAGE:0.5:6:576",
                "RRA:AVERAGE:0.5:24:576",
                "RRA:AVERAGE:0.5:288:576");
    RRDs::create(@args); my $e = RRDs::error(); die "ERROR: Cannot
create logfile: $e\n" if $e;
  }
  RRDs::update ($rrd,"N:$aantal"); my $e = RRDs::error(); die "ERROR
while updating rrd: $e\n" if $e;

# end of update rrd
}
exit;
list Fabio Flores · Mon, 6 Jun 2005 09:37:06 +0100 ·
Hi all,

Im trying to build my own RRD graphs. I've done my shell-script already, and
also I'm aware that I've got to modify hobbitgraph.cfg and hobbitserver.cfg.

But im not sure where should I put the --extra-script and --extra-tests
options. Should I add another line to hobbitcgi.cfg ? If so, what would be
the correct syntax?

Thanks,

Fabio
list Henrik Størner · Mon, 6 Jun 2005 09:20:47 +0000 (UTC) ·
quoted from Fabio Flores
In <user-e81a1bf42168@xymon.invalid> "Fabio Flores" <user-6f3e32ee6556@xymon.invalid> writes:
Im trying to build my own RRD graphs. I've done my shell-script already, and
also I'm aware that I've got to modify hobbitgraph.cfg and hobbitserver.cfg.
But im not sure where should I put the --extra-script and --extra-tests
options. Should I add another line to hobbitcgi.cfg ? If so, what would be
the correct syntax?
On the commandline for the hobbitd_larrd tool (ie. in hobbitlaunch.cfg)


Henrik
list Fabio Flores · Mon, 6 Jun 2005 12:49:18 +0100 ·
Thanks for the previous reply but I still couldnt get the graph. Here is the
full picture of what Ive done!

1) Ive created the script that will collect the information:

|#!/bin/sh

|# Input parameters: Hostname, testname (column), and messagefile
|HOSTNAME="$1"
|TESTNAME="$2"
|FNAME="$3"
|
|#NumProcs
|
|if [ "$TESTNAME" = "NumProcs" ]
|then
|        # Analyze the message we got
|        numprocs=`grep "^OK - " $FNAME | awk '{print $2}'`
|
|       # The RRD dataset definitions
|        echo "DS:numprocs:GAUGE:600:0:1000"
|
|        # The filename
|        echo "numprocs.rrd"
|
|        # The data
|        echo "$numprocs"
|fi
|
|exit 0

2) After that I`ve inserted the following on my hobbitlauch.cfg:

|--extra-script=/usr/local/hobbit/server/etc/customgraphs.sh --extra-test=Nu
mProcs

on both [larrdstatus] and [larrddata] blocks.

3) Then, I added the test "NumProcs" into the LARRDS= on my hobbitserver.cfg

4) Finally I put this settings on my hobbitgraph.cfg

|[NumProcs]
|        TITLE Number of Processes Running
|        YAXIS Processes
|        DEF:numprocs=numprocs.rrd:numprocs:AVERAGE
|        LINE2:numprocs#00CCCC:Number of Processes
|        COMMENT:\n
|        GPRINT:numprocs:LAST: \: %5.1lf (cur)
|        GPRINT:numprocs:MAX: \: %5.1lf (max)
|        GPRINT:numprocs:MIN: \: %5.1lf (min)
|        GPRINT:numprocs:AVERAGE: \: %5.1lf (avg)\n

5) Re-started hobbit, and the graph is not there.

Any help would be more then appreciated.

Thanks,

Fabio
list Henrik Størner · Mon, 6 Jun 2005 16:23:51 +0200 ·
quoted from Fabio Flores
On Mon, Jun 06, 2005 at 12:49:18PM +0100, Fabio Flores wrote:
Thanks for the previous reply but I still couldnt get the graph. Here is the
full picture of what Ive done!

1) Ive created the script that will collect the information:
[snip]
2) After that I`ve inserted the following on my hobbitlauch.cfg:
[snip]
3) Then, I added the test "NumProcs" into the LARRDS= on my hobbitserver.cfg

4) Finally I put this settings on my hobbitgraph.cfg
Looks OK - but: Do you have some extension script running on the client
that sends in a status- or data-message for a "NumProcs" column ? The
extra-scripts are for custom tests you run, so that kind of has to be
setup first.

I'm also wondering if you're actually duplicating some data that is
already there. The default Unix- and Windows BB clients report the
number of processes running on the host - it's already available if
you click on the "trends" column, just look at the graph titled
"Users and Processes".


Regards,
Henrik
list Fabio Flores · Tue, 7 Jun 2005 12:49:15 +0100 ·
I do have the script for my NumProcs monitor, on the hobbit console it
shows:

|Tue Jun 7 12:28:31 BST 2005
|OK - 236 processes running

But again, no graph. Ive decided to start with a simple graph then move to a
more complex one.

I cant see many things on the log files, apart from a few "2005-06-07
12:42:38 Unknown option : --larrd043" on bb-display.log
list Fabio Flores · Wed, 8 Jun 2005 11:13:40 +0100 ·
Anyone knows what the

"2005-06-07 12:42:38 Unknown option : --larrd043" on bb-display.log ?

Im still trying to produce my graph, but for some reason its not working. I
wonder if is there anything else I could investigate. Any logs, outputs,
etc.

Thanks
quoted from Fabio Flores

-----Original Message-----
From: Fabio Flores [mailto:user-6f3e32ee6556@xymon.invalid]
Sent: 07 June 2005 12:49
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] custom RRD data


I do have the script for my NumProcs monitor, on the hobbit console it
shows:

|Tue Jun 7 12:28:31 BST 2005
|OK - 236 processes running

But again, no graph. Ive decided to start with a simple graph then move to a
more complex one.

I cant see many things on the log files, apart from a few "2005-06-07
12:42:38 Unknown option : --larrd043" on bb-display.log
list Anatoli Bogajewski · Wed, 08 Jun 2005 15:35:53 +0200 ·
Hi folks,
Hi Henrik..

i am searching for an option to generate plaintext single service status availability report, as well done by "bb-replog.cgi", but using a mechanism which do it on a periodical basis.  Something identical to "bbgen" reporting options, probably one i've overlooked yet.

Any help would be appreciated. :)

Greetings,
 Anatoli Bogajewski
list Henrik Størner · Thu, 9 Jun 2005 07:17:58 +0200 ·
On Wed, Jun 08, 2005 at 11:13:40AM +0100, Fabio Flores wrote:
Anyone knows what the

"2005-06-07 12:42:38 Unknown option : --larrd043" on bb-display.log ?
The larrd-specific options for bbgen were dropped during one of the 
beta-versions. Just remove that from the bbgen command in hobbitlaunch.cfg


Henrik
list Henrik Størner · Tue, 12 Jul 2005 22:50:19 +0200 ·
quoted from Anatoli Bogajewski
On Wed, Jun 08, 2005 at 03:35:53PM +0200, user-4d3800b5a33a@xymon.invalid wrote:
i am searching for an option to generate plaintext single service status 
availability report, as well done by "bb-replog.cgi", but using a 
mechanism which do it on a periodical basis.  Something identical to 
"bbgen" reporting options, probably one i've overlooked yet.
So basically you want the text-format output from bb-replog.cgi
pre-generated for a list of host+service statuses, for a given
period of time - correct?

It's fairly easy to do since the bb-replog.cgi tool already has all of
the code needed to generate such a report; it already pre-builds these
text-format reports when you generate the availability report.

Let me know if I understand you correctly, and putting in the necessary
handles in bb-replog.cgi should be reasonably simple to do.


Regards,
Henrik