NagiosXi-adding host error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NagiosXi-adding host error

Post by scottwilkerson »

Can you show the output of the following

Code: Select all

cat /etc/sudoers|grep NAGIOS
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
smapple
Posts: 81
Joined: Fri Apr 08, 2016 11:43 pm

Re: NagiosXi-adding host error

Post by smapple »

The number of hosts in CMM is 19 and in nagios XI -home status its 18.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NagiosXi-adding host error

Post by scottwilkerson »

smapple wrote:The number of hosts in CMM is 19 and in nagios XI -home status its 18.
Ok but
scottwilkerson wrote:Can you show the output of the following

Code: Select all

cat /etc/sudoers|grep NAGIOS
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
smapple
Posts: 81
Joined: Fri Apr 08, 2016 11:43 pm

Re: NagiosXi-adding host error

Post by smapple »

Hi Team,

Any resolutions on this?

The following config files have incorrect permissions:

but does not list which files.

Please do check the screenshot that I sent in earlier post
smapple
Posts: 81
Joined: Fri Apr 08, 2016 11:43 pm

Re: NagiosXi-adding host error

Post by smapple »

Also I viewed the show written config:

it shows:

cannot open/overwrite the configuration file (Check permissions)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NagiosXi-adding host error

Post by scottwilkerson »

smapple wrote: Any resolutions on this?
No, you have not answered our latest question, and we cannot help you if you will not answer the questions for the task.


Please run the following command from the CLI and return the results

Code: Select all

cat /etc/sudoers|grep NAGIOS
Thank you
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
smapple
Posts: 81
Joined: Fri Apr 08, 2016 11:43 pm

Re: NagiosXi-adding host error

Post by smapple »

sadmin@nagios3 ~]$ sudo cat /etc/sudoers|grep NAGIOS
[sudo] password for sadmin:
User_Alias NAGIOSXI=nagios
User_Alias NAGIOSXIWEB=apache
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios checkconfig
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd status
NAGIOSXI ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/upgrade_to_latest.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/change_timezone.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/reset_config_perms.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/backup_xi.sh *
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/messages
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/httpd/error_log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/mysqld.log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXIWEB ALL = NOPASSWD:/etc/init.d/snmptt restart
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/repair_databases.sh
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
[sadmin@nagios3 ~]$
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NagiosXi-adding host error

Post by scottwilkerson »

Ok thank you .

Now, please run the following and return the results:

Code: Select all

cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
smapple
Posts: 81
Joined: Fri Apr 08, 2016 11:43 pm

Re: NagiosXi-adding host error

Post by smapple »

[sadmin@nagios3 ~]$ cd /usr/local/nagiosxi/scripts
[sadmin@nagios3 scripts]$ ./reconfigure_nagios.sh
-bash: ./reconfigure_nagios.sh: Permission denied
[sadmin@nagios3 scripts]$ sudo ./reconfigure_nagios.sh
[sudo] password for sadmin:
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=n@gweb' -O nagiosql.login--2018-06-28 12:18:51-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”

[ <=> ] 38,095 --.-K/s in 0.02s

2018-06-28 12:18:51 (2.24 MB/s) - “nagiosql.login” saved [38095]

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=n@gweb' -O nagiosql.login--2018-06-28 12:18:51-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”

[ <=> ] 38,095 --.-K/s in 0.02s

2018-06-28 12:18:52 (2.40 MB/s) - “nagiosql.login” saved [38095]

LOGIN SUCCESSFUL!
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'backend=1&cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2018-06-28 12:18:52-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.export.monitoring”

[ <=> ] 21,471 --.-K/s in 0.01s

2018-06-28 12:18:55 (1.71 MB/s) - “nagiosql.export.monitoring” saved [21471]

WRITE CONFIGS SUCCESSFUL!
OUTPUT:
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Warning: Service 'OS X CPU' on host 'reserves.apple.com' has no default contacts or contactgroups defined!
Warning: Service 'OS X Diskspace boot' on host 'reserves.apple.com' has no default contacts or contactgroups defined!
Warning: Service 'OS X FMS Services' on host 'reserves.apple.com' has no default contacts or contactgroups defined!
Warning: Service 'OS X Memory' on host 'reserves.apple.com' has no default contacts or contactgroups defined!
Warning: Service 'OS X Netvault Status' on host 'reserves.apple.com' has no default contacts or contactgroups defined!
Warning: Service 'Ping' on host 'reserves.apple.com' has no default contacts or contactgroups defined!
Warning: Service 'OS X AFP Connections' on host 'sqepm.apple.com' has no check time period defined!
Warning: Service 'OS X AFP Status' on host 'sqepm.apple.com' has no check time period defined!
Checked 119 services.
Warning: Host 'reserves.apple.com' has no default contacts or contactgroups defined!
Checked 18 hosts.
Checked 12 host groups.
Checked 0 service groups.
Checked 11 contacts.
Checked 8 contact groups.
Checked 124 commands.
Checked 18 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 18 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 18 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 9
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...
Stopping nagios: done.
Starting nagios: done.
[sadmin@nagios3 scripts]$
smapple
Posts: 81
Joined: Fri Apr 08, 2016 11:43 pm

Re: NagiosXi-adding host error

Post by smapple »

sadmin@nagios3 scripts]$ sudo ./reconfigure_nagios.sh
[sudo] password for sadmin:
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=n@gweb' -O nagiosql.login--2018-06-28 12:18:51-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”

[ <=> ] 38,095 --.-K/s in 0.02s

2018-06-28 12:18:51 (2.24 MB/s) - “nagiosql.login” saved [38095]

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=n@gweb' -O nagiosql.login--2018-06-28 12:18:51-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”

[ <=> ] 38,095 --.-K/s in 0.02s

2018-06-28 12:18:52 (2.40 MB/s) - “nagiosql.login” saved [38095]

LOGIN SUCCESSFUL!
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'backend=1&cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2018-06-28 12:18:52-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.export.monitoring”

[ <=> ] 21,471 --.-K/s in 0.01s

2018-06-28 12:18:55 (1.71 MB/s) - “nagiosql.export.monitoring” saved [21471]

WRITE CONFIGS SUCCESSFUL!
OUTPUT:
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Warning: Service 'OS X CPU' on host 'reserves.apple.com' has no default contacts or contactgroups defined!
Warning: Service 'OS X Diskspace boot' on host 'reserves.apple.com' has no default contacts or contactgroups defined!
Warning: Service 'OS X FMS Services' on host 'reserves.apple.com' has no default contacts or contactgroups defined!
Warning: Service 'OS X Memory' on host 'reserves.apple.com' has no default contacts or contactgroups defined!
Warning: Service 'OS X Netvault Status' on host 'reserves.apple.com' has no default contacts or contactgroups defined!
Warning: Service 'Ping' on host 'reserves.apple.com' has no default contacts or contactgroups defined!
Warning: Service 'OS X AFP Connections' on host 'sqepm.apple.com' has no check time period defined!
Warning: Service 'OS X AFP Status' on host 'sqepm.apple.com' has no check time period defined!
Checked 119 services.
Warning: Host 'reserves.apple.com' has no default contacts or contactgroups defined!
Checked 18 hosts.
Checked 12 host groups.
Checked 0 service groups.
Checked 11 contacts.
Checked 8 contact groups.
Checked 124 commands.
Checked 18 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 18 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 18 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 9
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...
Stopping nagios: done.
Starting nagios: done.
[sadmin@nagios3 scripts]$
Locked