|
From: Jessica H. <Je...@gm...> - 2005-02-16 09:17:57
|
Hi,
Another problem is that no data is storaged into the database. The
tables are all there, because I've seen them with show tables and
describe <name>
The database:
./mysql (as root)
dann
mysql> create database perfparse;
mysql> quit
now in my perfparse directory:
cat mysql_create.sql | mysql -u root -p -D perfparse
This only works as root (i don't know why)
now ./mysql again and a look to the database:
mysql> use perfparse;
Database changed
mysql> show tables;
+---------------------------------+
| Tables_in_perfparse |
+---------------------------------+
| perfdata_bin_summary |
| perfdata_bin_summary_data |
| perfdata_bin_summary_del_policy |
| perfdata_bin_summary_header |
| perfdata_delete_policy |
| perfdata_graphs |
| perfdata_host |
| perfdata_host_group |
| perfdata_prefs |
| perfdata_raw_summary |
| perfdata_raw_summary_data |
| perfdata_registry |
| perfdata_service |
| perfdata_service_bin |
| perfdata_service_metric |
| perfdata_service_raw |
| perfdata_state |
| perfdata_users |
+---------------------------------+
18 rows in set (0.00 sec)
mysql>
describe
perfdata_service;
+------------------------+--------------------------------+------+-----+----------+-------+
| Field | Type | Null | Key | Default |
Extra
|
+------------------------+--------------------------------+------+-----+----------+-------+
| service_id | int(11) | | UNI | 0 | |
| host_name | varchar(75) | | PRI | | |
| service_description | varchar(75) | | PRI | | |
| last_perfdata_raw | int(11) | YES | MUL | NULL | |
| raw_delete_policy | int(11) | YES | | NULL | |
| raw_delete_policy_name | varchar(20) | YES | MUL | NULL | |
| raw_delete_policy_type | enum('template','user','host') | | | template | |
| is_deleted | tinyint(4) | YES | | 0
|
|
+------------------------+--------------------------------+------+-----+----------+-------+
8 rows in set (0.00 sec)
mysql> select host_name
-> from perfdata_service;
Empty set (0.00 sec)
This is empty... I've worked after this documentation:
http://wiki.perfparse.org/tiki-index.php?page=BuildingMethod4Example
In the perfdata-service log, are always the newest datas and it is
updated regularly.
Then create a Nagios command to run perfparse-log2mysql every time a
log is
generated.
Is this the command???
# vi perfparse_nagios_pipe_command.pl
add at the end...
system ('/opt/nagios/bin/perfparse-log2mysql --serviceperf-log
/opt/nagios/var/perfdata-service.log');
I do this this like in this documentation:
http://wiki.perfparse.org/tiki-index.php?page=BuildingMethod4Example
But in the original documentation are more things described like:
5.2. Periodic Nagios Log Parse
Then add the following four lines to the 'HOST AND SERVICE
PERFORMANCE DATA PROCESSING COMMANDS' section:
xpdfile_host_perfdata_file=/usr/local/nagios/var/hostperf.log
xpdfile_host_perfdata_template=$TIMET$\t$HOSTNAME$\t$OUTPUT
$\t$PERFDATA$
xpdfile_service_perfdata_file=/usr/local/nagios/var/serviceperf.log
xpdfile_service_perfdata_template=$TIMET$\t$HOSTNAME$\t$SERVICEDESC
$\t$OUTPUT$\t$SERVICESTATE$\t$PERFDATA$
Should I write this down? or not?
5.3. Nagios Invokes Perfparse
Edit misccommands.cfg and add the following :
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" |
$USER2$/bin/perfparse-log2mysql -c $USER2$/etc/perfparse.cfg
}
$USER2$ is defined in resources.cfg and points to the
Perfparse installation directory.
In perfparse.cfg, Service_Log must be defined as "-".
5.4. Periodic User Log Parse
Edit misccommands.cfg and add the following :
define command{
command_name process-service-perfdata
command_line $USER2$/bin/perfparse_nagios_command.pl
$USER2$/var/perfdata-service.log "$TIMET$" "$HOSTNAME$"
"$SERVICEDESC$" "$OUTPUT$" "$SERVICESTATE$" "$PERFDATA$"
}
$USER2$ is defined in resources.cfg and points to the
Perfparse installation directory.
What's up with this??? Can I write down two of the same misccommands
in one cfg? I think not! I think I can use a command_name only once
a time, or I'm wrong?
Edit a script like this :
#!/bin/sh
$USER2=/perfparse/installation/directory
mv ${USER2}/var/perfdata-service.log
${USER2}/var/perfdata-service.log1
cat ${USER2}/var/perfdata-service.log1 |
${USER2}/bin/perfparse-log2mysql -c ${USER2}/etc/perfparse.cfg
rm ${USER2}/var/perfdata-service.log1
In perfparse.cfg, Service_Log must be defined as "-".
And what is this? Where should I let this script, How should I name
this? Must I write down something in a config file?
Sorry for my questions which looks like I'm a dummbass but I know
not so mus about this. I'm learning all these things but I don't
know what I should do now.
Wenn I look at googel for my problems I don't find many things. For
nagios I've found a very good german forum but I've found no english
or german perfparse forum. :-(
--
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
--
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
|