|
From: Flo G. <fl...@bi...> - 2004-09-02 11:58:51
|
Hi Developers
I have some problems to get perfparse generating graphs/charts. I use
perfparse 0.100.1 and it nicely fills my mysql database but i cannot get a
graph.
If i call perfchart.png or perfgant.png from the command line i get
segmentation faults.
i could fix perfchart.c:
diff -C 3 perfchart.c ../../test/perfparse-0.100.1/cgi/perfchart.c
*** perfchart.c 2004-09-02 10:28:22.000000000 +0200
--- ../../test/perfparse-0.100.1/cgi/perfchart.c 2004-08-30
22:27:54.000000000 +0200
***************
*** 374,382 ****
iValueCount++;
}
! if(data != NULL) {
! data->next = NULL;
! }
#ifdef DEBUG
fprintf(debug, "Count %d\n", iValueCount);
--- 374,380 ----
iValueCount++;
}
! data->next = NULL;
#ifdef DEBUG
fprintf(debug, "Count %d\n", iValueCount);
and here is a debugger session from perfgant.png:
(gdb) run
Starting program: /usr/local/nagios/sbin/perfgant.png
content-type: image/png
Program received signal SIGSEGV, Segmentation fault.
0x403793a6 in mallopt () from /lib/i686/libc.so.6
(gdb) bt
#0 0x403793a6 in mallopt () from /lib/i686/libc.so.6
#1 0x40378f05 in mallopt () from /lib/i686/libc.so.6
#2 0x40377cb8 in malloc () from /lib/i686/libc.so.6
#3 0x4039c5d2 in tzset () from /lib/i686/libc.so.6
#4 0x4039b34a in adjtime () from /lib/i686/libc.so.6
#5 0x4039bea6 in tzset () from /lib/i686/libc.so.6
#6 0x4039adf7 in timelocal () from /lib/i686/libc.so.6
#7 0x08049bee in getTime (sSQLDate=0x804cc38 "") at perfgant.c:476
#8 0x0804997d in getCGI () at perfgant.c:381
#9 0x08048e5b in main (argc=1, argv=0xbffff664) at perfgant.c:101
#10 0x4031bc57 in __libc_start_main () from /lib/i686/libc.so.6
(gdb)
(gdb) break 475
Breakpoint 1 at 0x8049be3: file perfgant.c, line 475.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/local/nagios/sbin/perfgant.png
content-type: image/png
Breakpoint 1, getTime (sSQLDate=0x804cc38 "") at perfgant.c:476
476 tOut = mktime(&recTime);
(gdb) display recTime
1: recTime = {tm_sec = 0, tm_min = 0, tm_hour = 0, tm_mday = 0, tm_mon =
-1,
tm_year = -1900, tm_wday = -1073744456, tm_yday = 1077405158, tm_isdst =
0,
tm_gmtoff = 134521938, tm_zone = 0x1 <Address 0x1 out of bounds>}
Some other things i encountered during the attempt to install perfparse:
The HOWTO/INSTALL/README files did not say where the sql file is. A "find"
pointed me to the right direction, but a line in the README would be
great!
First, the cgi binaries did timeout and i had really problems to get some
output at the browser. I straced the running cgi's and found out that they
want to read/write to a temporary file or pipe. But this file is not
generated by the executables or the "make install". Nothing in README as
far as i can see. And no error message. I did created a file, but should
it be a file or a pipe?
- xpdfile* configuration in nagios did not work for me, but you should
note in README that it also works if you use
host_perfdata_command=process-host-perfdata
service_perfdata_command=process-service-perfdata
in nagios.cfg and
define command{
command_name process-host-perfdata
command_line /usr/bin/printf "%b" "$TIMET$\t$HOSTNAME$\t$OUTPUT$\t$PERFDATA$\n" >> /usr/local/nagios/var/host-perfdata.out
}
define command{
command_name process-service-perfdata
command_line /usr/bin/printf "%b" "$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$OUTPUT$\t$SERVICESTATE$\t$PERFDATA$\n" >> /usr/local/nagios/var/service-perfdata.out
}
in misccommands.cfg
Last: some notes:
- Very cool feature. I want it!
- Why did you write it in C. Would'nt it be easier to use perl or php.
Probably the perfparse should remain in C for speed purposes, but the web
frontend would be more flexible in php.
Thank you,
Flo
|