Page 1 of 3

Problem Creating Repository

Posted: Wed Jun 16, 2021 4:25 pm
by mrochelle
I continue to get the following error when attempting to create a repository.
The snapshot repository in directory /usr/local/nagioslogserver/archives/snapshots_repository could not be created. Possibly due to permissions. Make sure the nagios user can write to the location.
Permissions are good.
drwxrwxrwx. 2 nagios nagios 6 Jun 16 10:12 snapshots_repository.
School me please. :geek:

Re: Problem Creating Repository

Posted: Thu Jun 17, 2021 2:31 pm
by vtrac
Hi,
How are you doing?

Please try the followings:

Code: Select all

chown -R nagios:nagios /usr/local/nagioslogserver/archives/snapshots_repository/
chown -R 775 /usr/local/nagioslogserver/archives/snapshots_repository/
Now, please try the creation of repository again.


Best Regards,
Vinh

Re: Problem Creating Repository

Posted: Thu Jun 17, 2021 3:09 pm
by mrochelle
Doing good Vinh. I tried your commands but no change. Same error as before: The snapshot repository in directory /usr/local/nagioslogserver/archives/snapshots_repository could not be created. Possibly due to permissions. Make sure the nagios user can write to the location.
Marcus

Re: Problem Creating Repository

Posted: Thu Jun 17, 2021 3:27 pm
by vtrac
Hi Marcus,
Do you have SELinux turned on?

Please run this:

Code: Select all

sestatus
Can you manually create a file under "snapshots_repository"?

Code: Select all

su - nagios
touch /usr/local/nagioslogserver/archives/snapshots_repository/test.out

ls -laZ /usr/local/nagioslogserver/archives/snapshots_repository/
Best Regards,
Vinh

Re: Problem Creating Repository

Posted: Fri Jun 18, 2021 12:20 pm
by mrochelle
SELinux status: disabled
brb.

nagioslogserver]$ ls -laZ /usr/local/nagioslogserver/archives/snapshots_repository/
total 0
drwxrwxr-x 2 nagios nagios ? 22 Jun 18 12:44 .
drwxrwxr-x. 3 nagios nagios unconfined_u:object_r:usr_t:s0 34 Jun 18 12:37 ..
-rw-r--r-- 1 nagios users ? 0 Jun 18 12:44 test.out

Re: Problem Creating Repository

Posted: Fri Jun 18, 2021 1:47 pm
by vtrac
Hi Marcus,
Hope you are having a good day.

Please run the below commands on your LogServer as "root":

Code: Select all

usermod -G nagios,apache,users nagios

chcon unconfined_u:object_r:usr_t:s0 /usr/local/nagioslogserver/archives/snapshots_repository

ls -laZ /usr/local/nagioslogserver/archives/snapshots_repository

systemctl restart httpd
Now, please try adding the repository again.


Best Regards,
Vinh

Re: Problem Creating Repository

Posted: Fri Jun 18, 2021 2:59 pm
by mrochelle
Ran the requested commands and problem still exits.

Re: Problem Creating Repository

Posted: Fri Jun 18, 2021 3:43 pm
by vtrac
Hi,
What OS does your Nagios LogServer runs on?

What version of LogServer?

Also, please post screenshot or outputs of the followings:

Code: Select all

grep apache /etc/group

grep apache /etc/group

ls -laZ /usr/local/nagioslogserver/archives/snapshots_repository

rpm -qa | grep openssh
If you could, please restart your OS (system).

Code: Select all

systemctl stop logstash
systemctl stop elasticsearch
reboot

Best Regards,
Vinh

Re: Problem Creating Repository

Posted: Fri Jun 18, 2021 4:05 pm
by vtrac
Hi,
It would be very helpful if you could upload screenshot of the error(s) on the webpage?

Please also upload outputs of these folders after you have reboot your server:
ls -la /usr/local/nagioslogserver

ls -la /usr/local/nagioslogserver/archives

Regards,
Vinh

Re: Problem Creating Repository

Posted: Fri Jun 18, 2021 4:20 pm
by vtrac
Hi,
I have asked my team member (Sean) for help, trying to look at the code that do the creation.

Please try this:

Code: Select all

cd /usr/local/nagioslogserver/archives/
rm -rf snapshots_repository

Now, please try adding the "snapshots_repository" again.

Best Regards,
Vinh