nagios user and reconfigure_nagios.sh permissions

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
kendallchenoweth
Posts: 195
Joined: Fri Sep 13, 2013 10:43 am

nagios user and reconfigure_nagios.sh permissions

Post by kendallchenoweth »

I know this can be done, because I've done it once and it didn't capture the commands to recreate it, so can you please help?

as the user nagios, on one server, I can run reconfigure_nagios.sh, but on another server it produces some of the errors shown below.

tar: usr/local/nagios/etc/hosts: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/hosts: Cannot change mode to rwsrwsr-x: Operation not permitted
tar: usr/local/nagios/etc/pnp/pages: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/pnp/pages: Cannot change mode to rwxrwsr-x: Operation not permitted
tar: usr/local/nagios/etc/pnp/check_commands: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/pnp/check_commands: Cannot change mode to rwxrwsr-x: Operation not permitted

I think I ran a script that reset permissions and then maybe relaxed some of the permissions, but I don't remember. I assume it's OK to be able to run reconfigure_nagios.sh as nagios instead of root. (I know that if you run the command as both root and nagios, the temporary file ownership messes it all up, but if I always run the command line as nagios, I don't have this problem.)

Thanks!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: nagios user and reconfigure_nagios.sh permissions

Post by lmiltchev »

What are the permissions on the nagios directory?

Code: Select all

ll -d usr/local/nagios
ll usr/local/nagios
Be sure to check out our Knowledgebase for helpful articles and solutions!
kendallchenoweth
Posts: 195
Joined: Fri Sep 13, 2013 10:43 am

Re: nagios user and reconfigure_nagios.sh permissions

Post by kendallchenoweth »

[nagios@nagiosxinonprod-00-ah scripts]$ ll -d /usr/local/nagios
drwxr-xr-x 8 root root 4096 Jan 17 21:15 /usr/local/nagios

[nagios@nagiosxinonprod-00-ah scripts]$ ll /usr/local/nagios
total 24
drwxrwxr-x 2 nagios nagios 4096 Jan 17 21:16 bin
drwsrwsr-x 7 apache nagios 4096 Mar 26 20:33 etc
drwxrwxr-x 2 nagios nagios 4096 Jan 17 21:17 libexec
drwxrwxr-x 2 nagios nagios 4096 Jan 17 21:15 sbin
drwxrwxr-x 14 nagios nagios 4096 Jan 17 21:16 share
drwxrwxr-x 6 nagios nagios 4096 Mar 26 21:17 var

[nagios@nagiosxinonprod-00-ah scripts]$ ll /usr/local/nagios/etc/hosts
total 8
-rw-rw-r-- 1 apache nagios 1178 Mar 26 20:33 default_host_disabled.cfg
-rw-rw-r-- 1 apache nagios 746 Mar 11 15:58 localhost.cfg
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: nagios user and reconfigure_nagios.sh permissions

Post by scottwilkerson »

One more set of permissions

Code: Select all

ll -d /usr/local/nagios/etc/hosts /usr/local/nagios/etc/services /usr/local/nagios/etc/pnp
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
kendallchenoweth
Posts: 195
Joined: Fri Sep 13, 2013 10:43 am

Re: nagios user and reconfigure_nagios.sh permissions

Post by kendallchenoweth »

[nagios@nagiosxinonprod-00-ah scripts]$ ll -d /usr/local/nagios/etc/hosts /usr/local/nagios/etc/services /usr/local/nagios/etc/pnp
drwsrwsr-x 2 apache nagios 4096 Mar 26 20:33 /usr/local/nagios/etc/hosts
drwxrwsr-x 4 apache nagios 4096 Mar 26 20:33 /usr/local/nagios/etc/pnp
drwsrwsr-x 2 apache nagios 4096 Mar 26 20:33 /usr/local/nagios/etc/services
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: nagios user and reconfigure_nagios.sh permissions

Post by scottwilkerson »

This is really strange, is the nagios user account expired?

Code: Select all

chage -l nagios
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
kendallchenoweth
Posts: 195
Joined: Fri Sep 13, 2013 10:43 am

Re: nagios user and reconfigure_nagios.sh permissions

Post by kendallchenoweth »

Last password change : Mar 11, 2014
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: nagios user and reconfigure_nagios.sh permissions

Post by lmiltchev »

If you haven't deleted the original install directory, cd into it and run "./upgrade":

Code: Select all

cd /tmp/nagiosxi
./upgrade
Make sure you don't have any config errors (you can apply configuration in the GUI).

Try again:

Code: Select all

su nagios
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
Let me know if this fixed your issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
kendallchenoweth
Posts: 195
Joined: Fri Sep 13, 2013 10:43 am

Re: nagios user and reconfigure_nagios.sh permissions

Post by kendallchenoweth »

i found the problem. It was a bad object definition and once I removed it, everything worked fine.

You can mark this issue closed.

Thanks!
Locked