[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Cheshire Cat Computing • View topic - nagios mysql loadconfig.pl

Cheshire Cat Computing

Software support and information
It is currently Tue Nov 11, 2025 11:59 am

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Thu Oct 26, 2006 5:04 am 
Offline
User

Joined: Thu Oct 26, 2006 4:50 am
Posts: 6
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


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 9:27 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
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.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 4:10 pm 
Offline
User

Joined: Thu Oct 26, 2006 4:50 am
Posts: 6
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.


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 4:35 pm 
Offline
User

Joined: Thu Oct 26, 2006 4:50 am
Posts: 6
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


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 4:46 pm 
Offline
User

Joined: Thu Oct 26, 2006 4:50 am
Posts: 6
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)


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Fri Oct 27, 2006 1:18 am 
Offline
User

Joined: Thu Oct 26, 2006 4:50 am
Posts: 6
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.


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Fri Oct 27, 2006 9:23 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
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

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Thu Feb 19, 2009 3:35 pm 
Offline
User

Joined: Thu Oct 26, 2006 4:50 am
Posts: 6
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


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 12 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group