This support forum board is for support questions relating to
Nagios XI , our flagship commercial network monitoring solution.
nytstevenlu
Posts: 12 Joined: Mon Mar 10, 2014 10:34 am
Post
by nytstevenlu » Mon Apr 14, 2014 6:06 pm
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:
Post
by scottwilkerson » Tue Apr 15, 2014 9:18 am
Normally these should be owned by the nagios user. Lets run
Code: Select all
chown nagios:nagios /usr/local/nagiosxi/scripts/nagiosql.*
nytstevenlu
Posts: 12 Joined: Mon Mar 10, 2014 10:34 am
Post
by nytstevenlu » Tue Apr 15, 2014 9:47 am
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
Post
by tmcdonald » Tue Apr 15, 2014 9:48 am
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