From: Ben C. <be...@cl...> - 2004-08-30 08:40:26
|
James, I am glad you are making progress. Odd, these tables should be automatically created when you use the CGI deletion policy editor. Can you tell me what version you are using and whether you have used the CGI deletion policy tools? Secondly, it looks like I forgot to give you one, please enter: mysql> insert into perfdata_delete_policy values ( 'Raw Default' , '90' ) ; See if that finally fixes things! Ben James Ochs wrote: > The table was empty prior to this: > > mysql> insert into perfdata_delete_policy ( 'Always' , '90' ) ; > ERROR 1064: You have an error in your SQL syntax. Check the manual that > corresponds to your MySQL server version for the right syntax to use > near ''Always' , '90' )' at line 1 > > mysql> insert into perfdata_delete_policy values ( 'Always' , '90' ) ; > Query OK, 1 row affected (0.12 sec) > > mysql> insert into perfdata_delete_policy values ( 'Bin Default' , '90' ) ; > Query OK, 1 row affected (0.57 sec) > > mysql> select * from perfdata_delete_policy > -> ; > +-------------+---------------+ > | policy_name | delete_policy | > +-------------+---------------+ > | Always | 90 | > | Bin Default | 90 | > +-------------+---------------+ > 2 rows in set (0.00 sec) > > mysql> quit > Bye > > And now I get: > > [root@mon-01 bin]# ./perfparse-db-tool --reset_host_delete_policy mon-01 > "UPDATE perfdata_host SET raw_delete_policy_type = 'template', > bin_delete_policy_type = 'template', raw_delete_policy_name = 'Raw > Default', bin_delete_policy_name = 'Bin Default' WHERE host_name = > 'mon-01'" failed: > > Cannot add or update a child row: a foreign key constraint fails > [root@mon-01 bin]# ./perfparse-db-purge -r > "UPDATE perfdata_service SET raw_delete_policy_name = 'Raw Default' > WHERE raw_delete_policy_type = 'template' AND raw_delete_policy_name IS > NULL" failed: > > Cannot add or update a child row: a foreign key constraint fails > [root@mon-01 bin]# > > -----Original Message----- > From: Ben Clewett [mailto:Be...@cl...] > Sent: Friday, August 27, 2004 12:33 AM > To: James Ochs; 'per...@li...' > Subject: Re: [Perfparse-users] re: deletion policys > > James, > > I need some information from your MySQL. Can you start the MySQL shell > (mysql -u nagios -pnagios -D nagios) and enter: > > mysql> select * from perfdata_delete_policy; > > This should produce at least this: > > +-------------+---------------+ > | policy_name | delete_policy | > +-------------+---------------+ > | Always | 30 | > | Bin Default | 30 | > +-------------+---------------+ > > Which will have different values in the second column. > > Let me know and we can go from there. > > Ben > > > > James Ochs wrote: > > > I'm still having this issue. Does anyone know what the foreign key that > > it is referring to is? Or how to find out? Here's the latest output: > > > > > > > > [jochs@mon-01 bin]$ > > [jochs@mon-01 bin]$ ./perfparse-db-tool --update > > [jochs@mon-01 bin]$ ./perfparse-db-purge -r > > "UPDATE perfdata_service_metric SET bin_delete_policy_name = 'Bin > > Default' WHERE bin_delete_policy_type = 'template' AND > > bin_delete_policy_name IS NULL" failed: > > > > Cannot add or update a child row: a foreign key constraint fails > > [jochs@mon-01 bin]$ ./perfparse-db-purge --show_config > > DB_User = "nagios" > > DB_Name = "nagios" > > DB_Pass = "n4g10s" > > DB_Host = "127.0.0.1" > > Drop_File = "/tmp/perfparse.drop" > > Service_Log = "/usr/local/nagios/var/serviceperf.log" > > Host_Log = "/usr/local/nagios/var/hostperf.log" > > Dummy_Hostname = "dummy" > > Delete_Service_Log = "No" > > Delete_Host_Log = "No" > > Nagios_Lock = "/usr/local/nagios/var/nagios.lock" > > Lock_File = "/var/lock/perfparse.lock" > > Be_Silent = "no" > > Do_Report = "no" > > Accept_Odd_Chars_in_Label = "no" > > Default_user_permissions_Policy = "rw" > > Default_user_permissions_Host_groups = "rw" > > [jochs@mon-01 bin]$ > > > > -----Original Message----- > > From: Tim Brazil [mailto:br...@se...] > > Sent: Wednesday, August 25, 2004 2:43 PM > > To: James Ochs > > Cc: per...@li... > > Subject: Re: [Perfparse-users] re: deletion policys > > > > Hi James > > > > The only other thing I did was changed to the newer sample version > > perfparse.cfg. > > > > Here are some thoughts... > > Did you see any "upgrade" output from ./perfparse-db-tool --update when > > you ran it indicating something actually happened? > > Is the binary from perfparse-db-tool the new one that was built with > > 0.99.09. > > I initially didn't "configure" correctly which "make install"ed > > perfparse-db-tool to the wrong directory (/usr/local/bin) which left > > the older version of perfparse-db-tool in place under > > /usr/local/nagios/bin > > > > Tim > > > > James Ochs wrote: > > > > > Upgrading to 0.99.09 didn't fix this problem for me. Nor did running > > > perfparse-db-tool --update. > > > > > > James > > > > > > -----Original Message----- > > > From: Tim Brazil [mailto:br...@se...] > > > Sent: Wednesday, August 25, 2004 1:39 PM > > > Cc: per...@li... > > > Subject: Re: [Perfparse-users] re: deletion policys > > > > > > Thanks Garry > > > I updated to 0.99.09, ran ./perfparse-db-tool --update and it > fixed my > > > problem. > > > > > > Tim > > > > > > Cook, Garry wrote: > > > > > > >per...@li... wrote: > > > > > > > > > > > >>I have been watching this post becasue I too am experiencing this > > > >>problem. It's been about 1 month since I've started collection > > > >>performance statistics and I'd like to do some cleanup. I > > > >>cannot create > > > >>deletion policies due to the "Cannot add or update a child row: a > > > >>foreign key constraint fails" error. > > > >>Any ideas on how to rectify this. I also ran the > ./perfparse-db-tool > > > >>--update to see whether it would correct the problem. It > > > >>didn't change > > > >>anything. I have Version 0.99.05. Schema Version 0.12 > > > >> > > > >>Thanks in advance > > > >>Tim > > > >> > > > >> > > > > > > > >I believe that this bug was fixed in Version 0.99.08, but it > might have > > > >been 0.99.09. Either way, you should definitely be using the latest > > > >stable version -> 0.99.09. > > > >I thought that I saw someone else post about this issue and say that > > the > > > >version upgrade did not fix it for them. However, they did not > mention > > > >if they ran 'perfparse-db-tool --update' after upgrading PerfParse. > > > > > > > >Everyone needs to realize something very important: > > > >With new versions, there are changes to the PerfParse code and there > > are > > > >sometimes changes made to the MySQL DB as well. You need to use the > > > >perfparse-db-tool to update your DB with each upgrade. This tool > > will be > > > >installed in your '<path_to>/nagios/bin/' directory, run it with the > > > >'--update' argument to ensure that DB changes are made properly. > > > > > > > >Garry W. Cook, CCNA > > > >Network Infrastructure Manager > > > >MACTEC, Inc. - http://www.mactec.com/ > > > >303.308.6228 (Office) - 720.220.1862 (Mobile) > > > > > > > > > > > >------------------------------------------------------- > > > >SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank > Media > > > >100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > > > >Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > > > >http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > > > >_______________________________________________ > > > >Perfparse-users mailing list > > > >Per...@li... > > > >https://lists.sourceforge.net/lists/listinfo/perfparse-users > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank > Media > > > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > > > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > > > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > > > _______________________________________________ > > > Perfparse-users mailing list > > > Per...@li... > > > https://lists.sourceforge.net/lists/listinfo/perfparse-users > > > > > > |