nagiosql.delete.service: Permission denied

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nytstevenlu
Posts: 12
Joined: Mon Mar 10, 2014 10:34 am

nagiosql.delete.service: Permission denied

Post by nytstevenlu »

Hi,

I have a local script on our Nagios XI server to delete decommissioned services/hosts automatically. The script calls /usr/local/nagiosxi/scripts/nagiosql_delete_service.php and /usr/local/nagiosxi/scripts/nagiosql_delete_host.php. It works well when I run it as root, however it gives me the following errors when I run it as user 'nagios':
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/services.php --no-check-certificate --post-data 'chbId_299=on&selModify=delete&hidModify&modus=checkform' -O nagiosql.delete.service
nagiosql.delete.service: Permission denied
I need to call these nagiosql scripts as user 'nagios' for multiple reasons (e.g. security), so is there a way to allow that?

Thanks,
Steven
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: nagiosql.delete.service: Permission denied

Post by scottwilkerson »

Normally these should be owned by the nagios user. Lets run

Code: Select all

chown nagios:nagios /usr/local/nagiosxi/scripts/nagiosql.*
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
nytstevenlu
Posts: 12
Joined: Mon Mar 10, 2014 10:34 am

Re: nagiosql.delete.service: Permission denied

Post by nytstevenlu »

Yep, that resolved the issue. Not sure why those files were owned by root in the first place..

Thanks a lot!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: nagiosql.delete.service: Permission denied

Post by tmcdonald »

nytstevenlu wrote:Yep, that resolved the issue. Not sure why those files were owned by root in the first place..

Thanks a lot!
Great! Nice to see a quick fix. I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked