Page 1 of 1

Not able to use Capacity Planning Component of Reports

Posted: Thu Feb 10, 2022 7:53 am
by HIINNS
All,

I am unable to use the Capacity Planning Component of Nagios XI. Below is the error obtained from /var/log/httpd/error_log.

Traceback (most recent call last):
File "/usr/local/nagiosxi/html/includes/components/capacityplanning/backend/capacityplanning.py", line 25, in <module>
filemode='a')
File "/usr/lib64/python2.7/logging/__init__.py", line 1529, in basicConfig
hdlr = FileHandler(filename, mode)
File "/usr/lib64/python2.7/logging/__init__.py", line 902, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib64/python2.7/logging/__init__.py", line 925, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/usr/local/nagiosxi/var/components/capacityplanning.log'

FIle /usr/local/nagiosxi/var/components/capacityplanning.log' has adequate permissions ownership nagios:nagios and the permissions I changed to RWXRWXRWX.

Any ideas of why this is?

Thank you,

Re: Not able to use Capacity Planning Component of Reports

Posted: Fri Feb 11, 2022 10:50 am
by ssax
Do you have selinux/fapolicyd/using ACLs or any other security software enabled?

Code: Select all

sestatus
systemctl status fapolicyd
mount | grep acl
What OS/version is it running?

Code: Select all

uname -a
cat /etc/*release
What are the permissions of the parent directories? Send the output of these commands:

Code: Select all

ls -ld /usr
ls -ld /usr/local
ls -ld /usr/local/nagiosxi
ls -ld /usr/local/nagiosxi/var
ls -ld /usr/local/nagiosxi/var/components
ls -l /usr/local/nagiosxi/var/components/capacityplanning.log

Re: Not able to use Capacity Planning Component of Reports

Posted: Mon Feb 14, 2022 6:26 am
by HIINNS
sestatus
SELinux status: disabled

systemctl status fapolicyd
Unit fapolicyd.service could not be found.

mount | grep acl

uname -a
Linux nnagsr02 3.10.0-1160.49.1.el7.x86_64 #1 SMP Tue Nov 9 16:09:48 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/*release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.9 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.9"
PRETTY_NAME="Red Hat Enterprise Linux"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.9:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.9
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.9"
Red Hat Enterprise Linux Server release 7.9 (Maipo)
Red Hat Enterprise Linux Server release 7.9 (Maipo)

ls -ld /usr
drwxr-xr-x. 16 root root 205 Jan 29 2021 /usr

ls -ld /usr/local
drwxr-xr-x. 17 root root 198 Feb 4 2021 /usr/local

ls -ld /usr/local/nagiosxi
drwxr-xr-x 10 root nagios 102 Nov 19 2020 /usr/local/nagiosxi

ls -ld /usr/local/nagiosxi/var
drwxr-xr-x 7 nagios nagios 4096 Feb 14 06:23 /usr/local/nagiosxi/var

ls -ld /usr/local/nagiosxi/var/components
drwsr-sr-x 3 nagios nagios 103 Feb 23 2021 /usr/local/nagiosxi/var/components

ls -l /usr/local/nagiosxi/var/components/capacityplanning.log
-rwxr-xr-x 1 nagios nagios 52452 Jan 6 12:06 /usr/local/nagiosxi/var/components/capacityplanning.log

Re: Not able to use Capacity Planning Component of Reports

Posted: Mon Feb 14, 2022 6:13 pm
by ssax
What are the output of these commands?

Code: Select all

grep nag /etc/group
grep "User \|Group " /etc/httpd/conf/httpd.conf
chage -l nagios
rpm -qa | grep mod_sec
Is your OS level SSH login AD or LDAP integrated? (Not the XI login, the backend OS level authentication)

Re: Not able to use Capacity Planning Component of Reports

Posted: Tue Feb 15, 2022 6:18 am
by HIINNS
grep nag /etc/group
nagcmd:x:1001:nagios,apache
nagios:x:1002:nagios,apache,snmptt

grep "User \|Group " /etc/httpd/conf/httpd.conf
User apache
Group apache

chage -l nagios
Last login: Tue Feb 15 06:05:23 EST 2022
Last password change : Feb 07, 2022
Password expires : May 08, 2022
Password inactive : May 09, 2022
Account expires : never
Minimum number of days between password change : 1
Maximum number of days between password change : 90
Number of days of warning before password expires : 14

rpm -qa | grep mod_sec
(nothing returned)

Is your OS level SSH login AD or LDAP integrated? (Not the XI login, the backend OS level authentication) - AD!!!

Re: Not able to use Capacity Planning Component of Reports

Posted: Tue Feb 15, 2022 3:43 pm
by kfanselow
Hi HIINNS,

Have you tried changing the owner of the file to apache ?

Code: Select all

find /usr/local/nagiosxi/var/components/capacityplanning.log -ls 
3053415    8 -rw-rw-r--   1 apache   nagios       6215 Nov 16 14:38 /usr/local/nagiosxi/var/components/capacityplanning.log

Thanks and Best Regards,
Keith

Re: Not able to use Capacity Planning Component of Reports

Posted: Wed Feb 16, 2022 9:22 am
by HIINNS
Wow, that was a simple fix. Thank you for your help. Please feel free to close out the case.

Re: Not able to use Capacity Planning Component of Reports

Posted: Wed Feb 16, 2022 10:10 am
by kfanselow
Glad that resolved the issue - we'll lock the thread.

Thanks and Best Regards,
Keith