Nagios Plugin for Cacti (NPC) Released
Moderators: Developers, Moderators
yes, it seems to be the mysql version
on a CoLinux system with mysql 5:
mysql>use cacti;
CREATE TABLE `npc_config_params` (`opt` char(64) NOT NULL default '',`value` int(11) default NULL,PRIMARY KEY (`opt`),UNIQUE KEY `opt` (`opt`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Nagios configuration data';
Query OK, 0 rows affected (0.08 sec)
but then
CREATE TABLE `npc_flapping_host` (`id` int(11) NOT NULL default '0',PRIMARY KEY (`id`),CONSTRAINT `flapping_host_ibfk_1` FOREIGN KEY (`id`) REFERENCES `npc_host` (`id`) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Flapping hosts';
ERROR 1005 (HY000): Can't create table './cacti/npc_flapping_host.frm' (errno: 150)
I found this:
http://forums.mysql.com/read.php?22,197 ... #msg-20340
"Try add an index..."
I updated from mysql 4.0.24 to mysql 5, cacti was installed and was working fine.
But after the upgrade cacti wasn't able to write into the db.
I can't add/view graphs.
Now I try mysql-server-4.1
edit:
Downgrade from mysql-server-5 to mysql-server-4.1 was OK.
Now my graphs in Cacti are visible again
but still:
mysql> CREATE TABLE `npc_flapping_host` (`id` int(11) NOT NULL default '0',PRIMARY KEY (`id`),CONSTRAINT `flapping_host_ibfk_1` FOREIGN KEY (`id`) REFERENCES `npc_host` (`id`) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Flapping hosts';
ERROR 1005 (HY000): Can't create table './cacti/npc_flapping_host.frm' (errno: 150)
on a CoLinux system with mysql 5:
mysql>use cacti;
CREATE TABLE `npc_config_params` (`opt` char(64) NOT NULL default '',`value` int(11) default NULL,PRIMARY KEY (`opt`),UNIQUE KEY `opt` (`opt`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Nagios configuration data';
Query OK, 0 rows affected (0.08 sec)
but then
CREATE TABLE `npc_flapping_host` (`id` int(11) NOT NULL default '0',PRIMARY KEY (`id`),CONSTRAINT `flapping_host_ibfk_1` FOREIGN KEY (`id`) REFERENCES `npc_host` (`id`) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Flapping hosts';
ERROR 1005 (HY000): Can't create table './cacti/npc_flapping_host.frm' (errno: 150)
I found this:
http://forums.mysql.com/read.php?22,197 ... #msg-20340
"Try add an index..."
I updated from mysql 4.0.24 to mysql 5, cacti was installed and was working fine.
But after the upgrade cacti wasn't able to write into the db.
I can't add/view graphs.
Now I try mysql-server-4.1
edit:
Downgrade from mysql-server-5 to mysql-server-4.1 was OK.
Now my graphs in Cacti are visible again
but still:
mysql> CREATE TABLE `npc_flapping_host` (`id` int(11) NOT NULL default '0',PRIMARY KEY (`id`),CONSTRAINT `flapping_host_ibfk_1` FOREIGN KEY (`id`) REFERENCES `npc_host` (`id`) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Flapping hosts';
ERROR 1005 (HY000): Can't create table './cacti/npc_flapping_host.frm' (errno: 150)
with mysql 4.1 those tables have been created.
but I have a problem to get rid of the one created by myswlf:
Table npc_config_params in database cacti
SQL desc `npc_config_params` failed : Can't open file: 'npc_config_params.ibd' (errno: 1)
I tried to drop the table through webmin:
SQL select count(*) from `npc_config_params` failed : Can't open file: 'npc_config_params.ibd' (errno: 1)
and with mysql:
mysql> use cacti
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> drop table npc_config_params;
ERROR 1051 (42S02): Unknown table 'npc_config_params'
same with cacti.npc_config_params ...
what can I do to dropt that table?
but I have a problem to get rid of the one created by myswlf:
Table npc_config_params in database cacti
SQL desc `npc_config_params` failed : Can't open file: 'npc_config_params.ibd' (errno: 1)
I tried to drop the table through webmin:
SQL select count(*) from `npc_config_params` failed : Can't open file: 'npc_config_params.ibd' (errno: 1)
and with mysql:
mysql> use cacti
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> drop table npc_config_params;
ERROR 1051 (42S02): Unknown table 'npc_config_params'
same with cacti.npc_config_params ...
what can I do to dropt that table?
Yes, I created that table as mentioned above.
That was after upgrading to mysql 5.
With mysql 5 the command to create that table was successful (manually with mysql>)
Then I downgraded to 4.1.
With 4.1 all other tables have been created autom. by your setup.php.
But the table that I created before (npc_config_params) isn't accessable anymore.
Maybe the downgrade deletet the file npc_config_params.ibd.
I will try that tomorrow:
mysql> use cacti;
mysql> SHOW CREATE TABLE npc_config_params \G
That was after upgrading to mysql 5.
With mysql 5 the command to create that table was successful (manually with mysql>)
Then I downgraded to 4.1.
With 4.1 all other tables have been created autom. by your setup.php.
But the table that I created before (npc_config_params) isn't accessable anymore.
Maybe the downgrade deletet the file npc_config_params.ibd.
I will try that tomorrow:
mysql> use cacti;
mysql> SHOW CREATE TABLE npc_config_params \G
mysql> use cacti
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> SHOW CREATE TABLE npc_config_params \G
ERROR 1016 (HY000): Can't open file: 'npc_config_params.ibd' (errno: 1)
mysql>
I will try to export everything from the cacti database without that table and create a new cacti-db.
EDIT:
1st tried to backup whole cacti-db:
Database backup failed : mysqldump failed :
mysqldump: Got error: 1016: Can't open file: 'npc_config_params.ibd' (errno: 1) when using LOCK TABLES
2nd try only the other tables:
Successfully backed up 217407 bytes from database cacti to file /opt/sql/cacti.sql.
Found this: http://bugs.mysql.com/search.php?cmd=di ... milar=5859
12852 2005-08-29
19:33 Server: InnoDB Closed
(78 days) S3 4.1, 5.0 All If .ibd file is missing and a table is opened, it cannot be dropped
I will use a fresh install....
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> SHOW CREATE TABLE npc_config_params \G
ERROR 1016 (HY000): Can't open file: 'npc_config_params.ibd' (errno: 1)
mysql>
I will try to export everything from the cacti database without that table and create a new cacti-db.
EDIT:
1st tried to backup whole cacti-db:
Database backup failed : mysqldump failed :
mysqldump: Got error: 1016: Can't open file: 'npc_config_params.ibd' (errno: 1) when using LOCK TABLES
2nd try only the other tables:
Successfully backed up 217407 bytes from database cacti to file /opt/sql/cacti.sql.
Found this: http://bugs.mysql.com/search.php?cmd=di ... milar=5859
12852 2005-08-29
19:33 Server: InnoDB Closed
(78 days) S3 4.1, 5.0 All If .ibd file is missing and a table is opened, it cannot be dropped
I will use a fresh install....
having problems compiling inserter.c for solaris
i am using
gcc -g -O2 -Wall -o inserter.o inserter.c -shared -I../include -I/usr/local/mysql/include/mysql -lmysqlclient -lz -fPIC
since my mysql includes are in /usr/local/mysql/include/mysql
i am getting
but i do have /usr/local/mysql/include/mysql/mysql.h
and /usr/local/mysql/include/mysql/errmsg.h
i am using
gcc -g -O2 -Wall -o inserter.o inserter.c -shared -I../include -I/usr/local/mysql/include/mysql -lmysqlclient -lz -fPIC
since my mysql includes are in /usr/local/mysql/include/mysql
i am getting
Code: Select all
inserter.c:43:25: mysql/mysql.h: No such file or directory
inserter.c:44:26: mysql/errmsg.h: No such file or directory
inserter.c:96: error: parse error before "mysql"
inserter.c:96: warning: type defaults to `int' in declaration of `mysql'
inserter.c:96: warning: data definition has no type or storage class
inserter.c: In function `nebmodule_init':
inserter.c:139: warning: implicit declaration of function `mysql_init'
inserter.c:143: warning: implicit declaration of function `mysql_real_connect'
inserter.c:143: error: `CLIENT_MULTI_STATEMENTS' undeclared (first use in this function)
inserter.c:143: error: (Each undeclared identifier is reported only once
inserter.c:143: error: for each function it appears in.)
inserter.c:144: warning: implicit declaration of function `mysql_error'
inserter.c:144: warning: format argument is not a pointer (arg 3)
inserter.c: In function `nebmodule_deinit':
inserter.c:166: warning: implicit declaration of function `mysql_close'
inserter.c: In function `loadconfig':
inserter.c:196: warning: implicit declaration of function `asprintf'
inserter.c: In function `querify':
inserter.c:911: warning: implicit declaration of function `mysql_real_escape_string'
inserter.c: In function `sql_dump':
inserter.c:1066: warning: implicit declaration of function `mysql_real_query'
inserter.c:1067: warning: implicit declaration of function `mysql_errno'
inserter.c:1067: warning: format argument is not a pointer (arg 2)
and /usr/local/mysql/include/mysql/errmsg.h
ok so i changed the -I/usr/local/mysql/include/mysql to /usr/local/mysql/include and it went a bit further but still stuck..
Code: Select all
gcc -g -O2 -Wall -o inserter.o inserter.c -shared -I../include -I/usr/local/mysql/include -lmysqlclient -lz -fPIC
inserter.c: In function `loadconfig':
inserter.c:196: warning: implicit declaration of function `asprintf'
ld: fatal: library -lmysqlclient: not found
ld: fatal: File processing errors. No output written to inserter.o
collect2: ld returned 1 exit status
jlim0930 wrote:having problems compiling inserter.c for solaris
i am using
gcc -g -O2 -Wall -o inserter.o inserter.c -shared -I../include -I/usr/local/mysql/include/mysql -lmysqlclient -lz -fPIC
since my mysql includes are in /usr/local/mysql/include/mysql
i am getting
but i do have /usr/local/mysql/include/mysql/mysql.hCode: Select all
inserter.c:43:25: mysql/mysql.h: No such file or directory inserter.c:44:26: mysql/errmsg.h: No such file or directory inserter.c:96: error: parse error before "mysql" inserter.c:96: warning: type defaults to `int' in declaration of `mysql' inserter.c:96: warning: data definition has no type or storage class inserter.c: In function `nebmodule_init': inserter.c:139: warning: implicit declaration of function `mysql_init' inserter.c:143: warning: implicit declaration of function `mysql_real_connect' inserter.c:143: error: `CLIENT_MULTI_STATEMENTS' undeclared (first use in this function) inserter.c:143: error: (Each undeclared identifier is reported only once inserter.c:143: error: for each function it appears in.) inserter.c:144: warning: implicit declaration of function `mysql_error' inserter.c:144: warning: format argument is not a pointer (arg 3) inserter.c: In function `nebmodule_deinit': inserter.c:166: warning: implicit declaration of function `mysql_close' inserter.c: In function `loadconfig': inserter.c:196: warning: implicit declaration of function `asprintf' inserter.c: In function `querify': inserter.c:911: warning: implicit declaration of function `mysql_real_escape_string' inserter.c: In function `sql_dump': inserter.c:1066: warning: implicit declaration of function `mysql_real_query' inserter.c:1067: warning: implicit declaration of function `mysql_errno' inserter.c:1067: warning: format argument is not a pointer (arg 2)
and /usr/local/mysql/include/mysql/errmsg.h
everything was compiled and installed per instructions.
but now i am unable to get nagios to run
when i run the check on nagios everything checks out fine
but i cant get the process to keep running
this is what i found on the log file
[1132349460] LOG VERSION: 2.0
[1132349460] initializing nagios-db mysql inserter...
[1132349460] nagios-db: inserter locked into db
[1132349460] Event broker module '/usr/local/nagios/modules/inserter.o' initialized successfully.
[1132349460] Finished daemonizing... (New PID=9416)
ps -ef | grep 9416 shows nothing
but now i am unable to get nagios to run
when i run the check on nagios everything checks out fine
but i cant get the process to keep running
this is what i found on the log file
[1132349460] LOG VERSION: 2.0
[1132349460] initializing nagios-db mysql inserter...
[1132349460] nagios-db: inserter locked into db
[1132349460] Event broker module '/usr/local/nagios/modules/inserter.o' initialized successfully.
[1132349460] Finished daemonizing... (New PID=9416)
ps -ef | grep 9416 shows nothing
Who is online
Users browsing this forum: No registered users and 0 guests