| Cheshire Cat Computing http://steveshipway.org/forum/ |
|
| nagios mysql loadconfig.pl http://steveshipway.org/forum/viewtopic.php?f=20&t=997 |
Page 1 of 1 |
| Author: | devans3428 [ Thu Oct 26, 2006 5:04 am ] |
| Post subject: | nagios mysql loadconfig.pl |
Hi Steve, I am recieving the error message below when executing the loadconfig.pl script. Can you point in the right direction? # ./loadconfig.pl Starting processing Wed Oct 25 10:36:37 2006 Connecting to database Wed Oct 25 10:36:37 2006 Parsing Nagios configuration files Wed Oct 25 10:36:37 2006... /opt/ACSnagios-2.5/etc/nagios.cfg"check_period" is invalid or module out of date: no such method "set_check_period" at ./loadconfig.pl line 290 Here is a snip from the loadconfig.pl 288 print "Parsing Nagios configuration files ".localtime()."...\n"; 289 print $CFGFILE; 290 $nagios = Nagios::Config->new( Filename=>($opt_c?$opt_c:$CFGFILE), Version=>$VERSION ); 291 print $VERSION; 292 if(!$nagios) { Here are my module versions: 'Getopt/Std.pm' => '1.05 from /usr/local/lib/perl5/5.8.7/Getopt/Std.pm' 'IO.pm' => '1.21 from /usr/local/lib/perl5/5.8.7/sun4-solaris/IO.pm' 'IO/Handle.pm' => '1.24 from /usr/local/lib/perl5/5.8.7/sun4-solaris/IO/Handle.pm' 'List/Util.pm' => '1.14 from /usr/local/lib/perl5/5.8.7/List/Util.pm' 'Nagios/Config.pm' => '/usr/local/lib/perl5/site_perl/5.8.7/Nagios/Config.pm' 'Nagios/Config/File.pm' => '/usr/local/lib/perl5/site_perl/5.8.7/Nagios/Config/File.pm' 'Nagios/Object.pm' => '0.06 from /usr/local/lib/perl5/site_perl/5.8.7/Nagios/Object.pm' 'Nagios/Object/Config.pm' => '/usr/local/lib/perl5/site_perl/5.8.7/Nagios/Object/Config.pm' Any help is appreciated Thanks |
|
| Author: | stevesh [ Thu Oct 26, 2006 9:27 am ] |
| Post subject: | |
You're using Nagios 2.5, it appears. Have you set the nagios version to 2.5 in the loadconfig.pl script so that it uses v2 syntax? Also, make sure you get the latest Nagios::Config module, as only the later ones can cope with the changes to the Nagios configuration syntax. |
|
| Author: | devans3428 [ Thu Oct 26, 2006 4:10 pm ] |
| Post subject: | |
Steve, THANKS...i got past the check_periods by upgrading to the latest Nagios::Config version14(actually Nagios::Object). Now i receive: # ./loadconfig.pl Starting processing Wed Oct 25 22:02:51 2006 Connecting to database Wed Oct 25 22:02:51 2006 Parsing Nagios configuration files Wed Oct 25 22:02:51 2006... /opt/ACSnagios-2.5/etc/nagios.cfg "hostgroup" is invalid or module out of date: no such method "set_hostgroup" at ./loadconfig.pl line 290 Here are my vars: my($DBHOST) = "localhost"; # database server my($DBUSER) = "nagios"; # database user # (must have ins/del/upd/create/drop privs) my($DBPASS) = "password goes here"; # database password my($DBPORT) = 3306; # database port (mysql is normally 3306) my($DBNAME) = "nagios"; # database name my($PREFIX) = "nagios"; # table name prefix my($dbh,$sth); my($nagios); my($CFGFILE) = "/opt/ACSnagios-2.5/etc/nagios.cfg"; my($HOSTEXTINFO) = "/opt/ACSnagios-2.5/etc/hostextinfo.cfg"; my($VERSION) = 2.5; # or 2.0 I also downloaded and installed the latest DBI version just to make sure. Hey thanks again. |
|
| Author: | devans3428 [ Thu Oct 26, 2006 4:35 pm ] |
| Post subject: | |
Updated Perl module version: 'Nagios/Config.pm' => '/usr/local/lib/perl5/site_perl/5.8.7/Nagios/Config.pm' 'Nagios/Config/File.pm' => '/usr/local/lib/perl5/site_perl/5.8.7/Nagios/Config/File.pm' 'Nagios/Object.pm' => '0.11 from /usr/local/lib/perl5/site_perl/5.8.7/Nagios/Object.pm' 'Nagios/Object/Config.pm' => '/usr/local/lib/perl5/site_perl/5.8.7/Nagios/Object/Config.pm' Object did change for 6 to 11 |
|
| Author: | devans3428 [ Thu Oct 26, 2006 4:46 pm ] |
| Post subject: | |
Just for information...Here is my Build Test of Nagios::Object version 14 # ./Build test t/00object..................# creating a Nagios::TimePeriod object ... # creating a Nagios::Command object ... # creating a Nagios::Contact object ... # creating a Nagios::ContactGroup object ... # creating a Nagios::Host object ... # # testing templates ... # # creating service template ... t/00object..................ok t/05object_config...........ok t/10config_file.............ok t/50config..................ok 1/0# run tests to make sure inherited Nagios::Config::File methods work # run tests to make sure inherited Nagios::Config::Object methods work t/50config..................ok t/51config-wildcards........ok t/98nagios-sample-config....# testing with Nagios sample file sample-config-bigger.cfg ... t/98nagios-sample-config....ok 1/0# testing with Nagios sample file sample-config-minimal.cfg ... t/98nagios-sample-config....ok t/99config-extend...........ok t/nagios2config.............ok 1/12# run tests to make sure inherited Nagios::Config::File methods work # run tests to make sure inherited Nagios::Config::Object methods work t/nagios2config.............ok t/nestedtemplates...........Use of uninitialized value in sprintf at t/nestedtemplates.t line 20. t/nestedtemplates...........ok t/statuslog.................ok All tests successful. Files=10, Tests=530, 3 wallclock secs ( 2.20 cusr + 0.33 csys = 2.53 CPU) |
|
| Author: | devans3428 [ Fri Oct 27, 2006 1:18 am ] |
| Post subject: | |
Hey Steve just an FYI: I sent Al Tobey(Created Nagios::Object from CPAN) an email with the error msg i am receiving because i am receiving the same error with his test script. The comments below are my comments to Tobey: I downloaded the latest module of Nagios::Object-0.14. Ran your test > script and received the following error. > > # ./config_status_demo.pl -c /opt/ACSnagios/etc/nagios.cfg -l > /opt/ACSnagios/var/status.dat > > "hostgroup" is invalid or module out of date: no such method "set_hostgroup" > at ./config_status_demo.pl line 34 These are his comments [size=18]"Probably entirely my fault. I'll look into it in the next couple days."[/size] If you think there is something else i should try, let me know Thanks for the perl scripts and the help on getting the activated. |
|
| Author: | stevesh [ Fri Oct 27, 2006 9:23 am ] |
| Post subject: | |
OK, glad to hear things are going the right way. To be honest, with Nagios 2.5 you get the new hooks into the system and so it is possible to set it up to use databases directly, without having to load the config or log into mysql using an external program like this. However I don't know exactly how to do it, and we have Nagios 1.4 here so we have to use this method. Once we upgrade to Nagios 2, I will probably move to the native API for database use, if possible. I know its relatively easy in 2.5 to hook in database support for logs, I just don't know how to do it for the configuration |
|
| Author: | devans3428 [ Thu Feb 19, 2009 3:35 pm ] |
| Post subject: | Re: nagios mysql loadconfig.pl |
Steve, Seems I am not able to locate my previous post about loadlogs.pl stop working. You had replied to my initial post asking me if i had version 2.X of loadlogs. I had sent you the cksum for the loadlogs to verify if I had the correct version. As you can see I have been running Version 2.5. I you cant locate my previous post for a couple of days ago, let me know and i will resubmit my issue. Thanks |
|
| Page 1 of 1 | All times are UTC + 12 hours [ DST ] |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|