migration tools for Nagios Core

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re: migration tools for Nagios Core

Postby DOkuwa » Fri Oct 06, 2017 11:26 am

error message

sed -i --regexp-extended -e "s/^(\s*check_result_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g" \ -e 's/^(\s*use_embedded_perl_implicitly\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ -e 's/^(\s*sleep_time\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ -e 's/^(\s*p1_file\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ -e 's/^(\s*external_command_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ -e 's/^(\s*enable_embedded_perl\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ -e 's/^(\s*command_check_interval\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ nagios.cfg
sed: can't read -e: No such file or directory
sed: can't read s/^(\s*use_embedded_perl_implicitly\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g: No such file or directory
sed: can't read -e: No such file or directory
sed: can't read s/^(\s*sleep_time\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g: No such file or directory
sed: can't read -e: No such file or directory
sed: can't read s/^(\s*p1_file\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g: No such file or directory
sed: can't read -e: No such file or directory
sed: can't read s/^(\s*external_command_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g: No such file or directory
sed: can't read -e: No such file or directory
sed: can't read s/^(\s*enable_embedded_perl\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g: No such file or directory
sed: can't read -e: No such file or directory
sed: can't read s/^(\s*command_check_interval\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g: No such file or directory
sed: can't read nagios.cfg: No such file or directory
DOkuwa
 
Posts: 47
Joined: Tue Aug 15, 2017 3:54 pm

Re: migration tools for Nagios Core

Postby DOkuwa » Fri Oct 06, 2017 11:40 am

scott,

error message

sed -i --regexp-extended -e "s/^(\s*check_result_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g" \ -e 's/^(\s*use_embedded_perl_implicitly\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ -e 's/^(\s*sleep_time\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ -e 's/^(\s*p1_file\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ -e 's/^(\s*external_command_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ -e 's/^(\s*enable_embedded_perl\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ -e 's/^(\s*command_check_interval\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ nagios.cfg
sed: can't read -e: No such file or directory
sed: can't read s/^(\s*use_embedded_perl_implicitly\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g: No such file or directory
sed: can't read -e: No such file or directory
sed: can't read s/^(\s*sleep_time\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g: No such file or directory
sed: can't read -e: No such file or directory
sed: can't read s/^(\s*p1_file\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g: No such file or directory
sed: can't read -e: No such file or directory
sed: can't read s/^(\s*external_command_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g: No such file or directory
sed: can't read -e: No such file or directory
sed: can't read s/^(\s*enable_embedded_perl\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g: No such file or directory
sed: can't read -e: No such file or directory
sed: can't read s/^(\s*command_check_interval\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g: No such file or directory
sed: can't read nagios.cfg: No such file or directory
DOkuwa
 
Posts: 47
Joined: Tue Aug 15, 2017 3:54 pm

Re: migration tools for Nagios Core

Postby scottwilkerson » Fri Oct 06, 2017 1:24 pm

DOkuwa wrote:No such file or directory


Is nagios.cfg in this directory?
Code: Select all
ls -al nagios.cfg
User avatar
scottwilkerson
CTO
 
Posts: 7903
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: migration tools for Nagios Core

Postby DOkuwa » Fri Oct 06, 2017 4:40 pm

yes it is in the /usr/local/nagios/etc
DOkuwa
 
Posts: 47
Joined: Tue Aug 15, 2017 3:54 pm

Re: migration tools for Nagios Core

Postby scottwilkerson » Mon Oct 09, 2017 11:31 am

lets change the command to
Code: Select all
sed -i --regexp-extended -e "s/^(\s*check_result_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g" \
   -e 's/^(\s*use_embedded_perl_implicitly\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*sleep_time\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*p1_file\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*external_command_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*enable_embedded_perl\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*command_check_interval\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ /usr/local/nagios/etc/nagios.cfg


copy the whole thing and paste command in terminal
User avatar
scottwilkerson
CTO
 
Posts: 7903
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: migration tools for Nagios Core

Postby DOkuwa » Tue Oct 10, 2017 9:49 am

still getting the same error message
DOkuwa
 
Posts: 47
Joined: Tue Aug 15, 2017 3:54 pm

Re: migration tools for Nagios Core

Postby scottwilkerson » Tue Oct 10, 2017 9:57 am

lets step back because this is taking more effort trying to run this script than necessary..

Can you verify your config

Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg


If so, there is nothing else to do.

If you get an error about an invalid config option then we likely need to remove it from /usr/local/nagios/etc/nagios.cfg
User avatar
scottwilkerson
CTO
 
Posts: 7903
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: migration tools for Nagios Core

Postby DOkuwa » Tue Oct 10, 2017 10:20 am

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.3.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-08-24
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: Duplicate definition found for host 'generic-host' (config file '/usr/local/nagios/etc/hosts.cfg', starting on line 88)
Error: Could not add object property in file '/usr/local/nagios/etc/hosts.cfg' on line 89.
Error processing object config files!


***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data definitions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
DOkuwa
 
Posts: 47
Joined: Tue Aug 15, 2017 3:54 pm

Re: migration tools for Nagios Core

Postby scottwilkerson » Tue Oct 10, 2017 12:04 pm

now we need to see /usr/local/nagios/etc/hosts.cfg
User avatar
scottwilkerson
CTO
 
Posts: 7903
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: migration tools for Nagios Core

Postby DOkuwa » Wed Oct 11, 2017 9:35 am

hostsfile as requested
Attachments
host.cfg-updated.docx
(19.69 KiB) Downloaded 4 times
DOkuwa
 
Posts: 47
Joined: Tue Aug 15, 2017 3:54 pm

PreviousNext

Return to Nagios Core

Who is online

Users browsing this forum: dwasswa, ikekim and 27 guests