Page 1 of 1

Error:Unable to write to temp_path('/tmp')-Permission denied

Posted: Mon Jan 02, 2012 7:41 am
by nagiostool
Hi i have a problem while restarting nagios service and the following is the error message.
Please help me

Checking hosts.. Checked 40 hosts Checking host groups.. Checked 2 host groups Checking service groups.. Checked 2 service groups Checking contacts.. Checked 13 contacts Checking contact groups.. Checked 3 contact groups Checking service escalations.. Checked 0 service escalations Checking service dependencies.. Checked 0 service dependencies Checking host escalations.. Checked 70 host escalations Checking host dependencies.. Checked 0 host dependencies Checking commands.. Checked 77 commands Checking time periods.. Checked 20 time periods Checking for circular paths between hosts.. Checking for circular host and service dependencies.. Checking global event handlers.. Checking obsessive compulsive processor commands.. Checking misc settings.. Error: Unable to write to temp_path ('/tmp') - Permission denied

Total Warnings: 303
Total Errors: 1

***> One or more problems was encountered while running the pre-flight check..
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. 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

Re: Error:Unable to write to temp_path('/tmp')-Permission de

Posted: Mon Jan 02, 2012 1:13 pm
by lmiltchev
Go to Admin->Monitoring Config->Check File Permissions and make sure they are OK.

Go to Admin->System Config->Reset Security Credentials and click on "Update Credentials".

You can also run in terminal:

Code: Select all

# cd /usr/local/nagiosxi/scripts
# ./reset_config_perms
If this is not helping with your permissions issues, try fixing your global permissions, following the steps in this document:
http://assets.nagios.com/downloads/nagi ... ssions.pdf

Hope this helps.

Re: Error:Unable to write to temp_path('/tmp')-Permission de

Posted: Mon Jan 02, 2012 11:35 pm
by nagiostool
lmiltchev wrote:Go to Admin->Monitoring Config->Check File Permissions and make sure they are OK.

Go to Admin->System Config->Reset Security Credentials and click on "Update Credentials".

You can also run in terminal:

Code: Select all

# cd /usr/local/nagiosxi/scripts
# ./reset_config_perms
If this is not helping with your permissions issues, try fixing your global permissions, following the steps in this document:
http://assets.nagios.com/downloads/nagi ... ssions.pdf

Hope this helps.
I have tried everything which was said by you but didn't work, the file permissions are also fine no problem with them.

When i tried to edit one of the host templet and apply configuration i got an error in the snapshot it was reflecting the below error


Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Error in configuration file '/usr/local/nagios/etc/nagios.cfg' - Line 158 (Temp path is not a valid directory)
Error processing main config file!



***> 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 defintions. 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.


I'm not able to upload any new monitoring wizards too , its giving the error as upload failed
The above information might be helpfull for you to solve my problem

Re: Error:Unable to write to temp_path('/tmp')-Permission de

Posted: Tue Jan 03, 2012 10:58 am
by scottwilkerson
Somehow your directory permissions must have gotten buggered up

First, lets do this

Code: Select all

chmod 1777 /tmp
If for some reason you get an error like this:
chmod: cannot access `/tmp': No such file or directory

Then run

Code: Select all

mkdir /tmp
chmod 1777 /tmp

Re: Error:Unable to write to temp_path('/tmp')-Permission de

Posted: Tue Jan 03, 2012 11:09 am
by lmiltchev
Open your "nagios.cfg" file in a text editor:

Code: Select all

# vi /usr/local/nagios/etc/nagios.cfg
Find line 158 - in vi, you can show numbers by typing:

Code: Select all

:set number
You should see:

Code: Select all

temp_path=/tmp
Also, type this command in terminal and post the output:

Code: Select all

# ls -l /

Re: Error:Unable to write to temp_path('/tmp')-Permission de

Posted: Wed Jan 04, 2012 1:25 am
by nagiostool
scottwilkerson wrote:Somehow your directory permissions must have gotten buggered up

First, lets do this

Code: Select all

chmod 1777 /tmp
If for some reason you get an error like this:
chmod: cannot access `/tmp': No such file or directory

Then run

Code: Select all

mkdir /tmp
chmod 1777 /tmp
Thanks a lot the above command worked

Re: Error:Unable to write to temp_path('/tmp')-Permission de

Posted: Wed Jan 04, 2012 11:10 am
by scottwilkerson
Glad we got if fixed

Re: Error:Unable to write to temp_path('/tmp')-Permission de

Posted: Tue Apr 14, 2015 12:46 pm
by lsazzad
Hi,

I am in a serious problem. I was unable to change nagios files using a user. So, changed file permission & created a group. But after that NAGIOS isn't getting process status.
I have executed following commands.

groupadd local_users
usermod -a -G local_users sabuj
chown -R root:local_users /usr/local
chmod -R 2775 /usr/local
find /usr/local -type f -exec chmod 0774 '{}' \;

I have added nagios user into local_user group. But no result. Do, i need to add some more user? In that case i want to undone it.

How i can undone it? Please reply ASAP>>>>

Re: Error:Unable to write to temp_path('/tmp')-Permission de

Posted: Tue Apr 14, 2015 6:55 pm
by Box293
This is a very old thread you've added your question to.

Can you please create a new thread with your problem.