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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nagiostool
Posts: 72
Joined: Wed Jul 20, 2011 2:17 am

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

Post 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
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

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

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
nagiostool
Posts: 72
Joined: Wed Jul 20, 2011 2:17 am

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

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

Post 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 /
Be sure to check out our Knowledgebase for helpful articles and solutions!
nagiostool
Posts: 72
Joined: Wed Jul 20, 2011 2:17 am

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post by scottwilkerson »

Glad we got if fixed
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
lsazzad
Posts: 72
Joined: Tue Apr 07, 2015 6:52 am
Location: ​Osnabrück, Deutschland
Contact:

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

Post 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>>>>
Regards
Sazzad
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

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

Post by Box293 »

This is a very old thread you've added your question to.

Can you please create a new thread with your problem.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked