Page 1 of 2

Web Inject config files not removing

Posted: Sun Nov 23, 2014 1:28 pm
by krobertson71
I have been testing with web inject. Once I was done I removed the web inject service from CCM > Applied Configuration.

I removed the host google.com and applied configuration.

I had two of these where I was trying different things, but were removed with the same steps above.

When I go into /usr/local/nagiosxi/etc/components/webinject the files are still there even though they are no longer showing in CCM or under Hosts or Services from the Home screen.

Code: Select all

-rw-r--r-- 1 apache nagios   224 Nov 23 12:49 google_com__Web_Transaction_config.xml
-rw-r--r-- 1 apache nagios    94 Nov 23 12:49 google_com__Web_Transaction_testdata.xml
-rwxrwxr-x 1 apache nagios 63271 Jun 10 16:52 webinject.pl
-rw-r--r-- 1 apache nagios   228 Nov 23 12:38 www_google_com__Web_Transaction_config.xml
-rw-r--r-- 1 apache nagios   196 Nov 23 12:38 www_google_com__Web_Transaction_testdata.xml
I am sudoed to the nagios user but it does not have permission to remove the files.

Bigger question is why these are not being removed when I remove them via CCM??

Re: Web Inject config files not removing

Posted: Mon Nov 24, 2014 10:14 am
by tmcdonald
What version of XI are you using?

Re: Web Inject config files not removing

Posted: Mon Nov 24, 2014 11:11 am
by krobertson71
From earlier post I had a time of getting to 2.0. That is where I am now.

Re: Web Inject config files not removing

Posted: Mon Nov 24, 2014 5:15 pm
by tmcdonald
I'm seeing this same behavior. I don't believe the CCM ever did this to begin with. Would you like me to put in a feature request for this? You should still be able to remove them as the root user.

Re: Web Inject config files not removing

Posted: Mon Nov 24, 2014 9:27 pm
by krobertson71
tmcdonald wrote:I'm seeing this same behavior. I don't believe the CCM ever did this to begin with. Would you like me to put in a feature request for this? You should still be able to remove them as the root user.
Im in a bigger environment and do not have root access to these servers... Just sudo to nagios. The files are owned by APACHE NAGIOS.

You would think the Nagios user could remove them.


And yes. I think when you remove the service it should remove the config as part of that process. We are planning to do many of these.

Re: Web Inject config files not removing

Posted: Tue Nov 25, 2014 11:50 am
by tmcdonald
Feature request has been filed. ID 4538.

As for removal, what are the permissions on the webinject files in your environment?

Re: Web Inject config files not removing

Posted: Tue Nov 25, 2014 1:06 pm
by krobertson71
They are in the first post. Here they are again.. Let me know if you are looking for something different. Cleaning them up would be just giving the nagios user permissions to that directory to allow deletion. What I think should be done is that they are removed when the service is removed and configuration applied, but you have submitted that already and I thank you for it.

Code: Select all

-rw-r--r-- 1 apache nagios   224 Nov 23 12:49 google_com__Web_Transaction_config.xml
-rw-r--r-- 1 apache nagios    94 Nov 23 12:49 google_com__Web_Transaction_testdata.xml
-rwxrwxr-x 1 apache nagios 63271 Jun 10 16:52 webinject.pl
-rw-r--r-- 1 apache nagios   228 Nov 23 12:38 www_google_com__Web_Transaction_config.xml
-rw-r--r-- 1 apache nagios   196 Nov 23 12:38 www_google_com__Web_Transaction_testdata.xml

Re: Web Inject config files not removing

Posted: Tue Nov 25, 2014 1:24 pm
by tmcdonald
Sorry, I meant to ask for the folder* not the files.

But yea, I can imagine how it might be done on the backend. The tricky part is having the Core Config Manager know what counts as a Webinject service. The Webinject files are named similarly to the services so it might be possible to just go through and do a comparison. If it can't be done as part of the Apply Config, would it work as a component or a cron job that does it on a schedule?

Re: Web Inject config files not removing

Posted: Tue Nov 25, 2014 2:24 pm
by krobertson71
Here are the folder permissions:

Re: Web Inject config files not removing

Posted: Tue Nov 25, 2014 4:16 pm
by tmcdonald
That's matching up with my system, and I am able to su to nagios and delete them with no problem. Do you have an ACL or SELinux enabled that might be blocking the deletion?