Page 1 of 1

Nagios Agent(NCPA) permission issue in AIX servers

Posted: Mon Apr 09, 2018 3:04 am
by muadba
Hi Team,

I have installed NCPA agent in AIX-7.1 servers and while onboarding the OS parameters, we are getting the below error in server side:

Nagios server side error:
==========================
]# /usr/local/nagios/libexec/check_ncpa.py -v -H cass6 -P 5666 -t 'mytoken' -M 'system/agent_version'
Connecting to: https://cass6:5666/api/system/agent_ver ... en&check=1
An error occurred:HTTP Error 500: INTERNAL SERVER ERROR
[root@dc1lp161990 nagios]# /usr/local/nagios/libexec/check_ncpa.py -v -H dc2ap10118 -P 5666 -t 'mytoken' -M 'system/agent_version'
Connecting to: https://dc2ap10118:5666/api/system/agen ... en&check=1
An error occurred:HTTP Error 500: INTERNAL SERVER ERROR
==========================

On checking the client ncpa_listener error log, I got the below error:

==========================
bash-4.2$ pwd
/usr/local/ncpa/var/log
bash-4.2$ tail -f ncpa_listener.log
File "/opt/freeware/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
File "/tmp/test/ncpa/agent/listener/server.py", line 168, in token_auth_decoration
File "/tmp/test/ncpa/agent/listener/server.py", line 896, in api
File "/tmp/test/ncpa/agent/listener/psapi.py", line 269, in getter
File "/tmp/test/ncpa/agent/listener/psapi.py", line 216, in get_root_node
File "/tmp/test/ncpa/agent/listener/psapi.py", line 176, in get_disk_node
File "/opt/freeware/lib/python2.7/site-packages/psutil/__init__.py", line 1979, in disk_partitions
File "/opt/freeware/lib/python2.7/site-packages/psutil/_psaix.py", line 193, in disk_partitions
OSError: [Errno 13] Permission denied
2018-04-09 17:19:19,833 18874536 INFO 10.34.69.28 - - [2018-04-09 17:19:19] "GET /api/memory/swap/?token=mytoken&warning=50&critical=80&units=Gi&check=1 HTTP/1.1" 500 2362 0.005731
==========================

Could you please advise on this ?

We are having other AIX 7.1 servers in which this agent is working fine. What could be the issue ?

Re: Nagios Agent(NCPA) permission issue in AIX servers

Posted: Mon Apr 09, 2018 10:30 am
by lmiltchev
What are the permissions on the /tmp directory? There have been some issues with insufficient permissions on the /tmp directory on AIX servers. The issues were resolved by running:

Code: Select all

chmod 777 /tmp
Do you want to try running the command above to see if this is going to solve your issue? If this doesn't help, please let us know.

Re: Nagios Agent(NCPA) permission issue in AIX servers

Posted: Mon Apr 09, 2018 10:26 pm
by muadba
Hi,

/tmp have full permission already.
================
bash-4.2$ ls -ld /tmp
drwxrwxrwt 6025 bin bin 626688 Apr 10 13:20 /tmp
bash-4.2$
================

Could you please let us know what else we can check in it ?

We are starting the agent as non-root user(nagios) using the below command with sudo privileges.
===========================
sudo /usr/bin/startsrc -e LIBPATH=/usr/local/ncpa -s ncpa_listener
===========================

Re: Nagios Agent(NCPA) permission issue in AIX servers

Posted: Tue Apr 10, 2018 9:30 am
by lmiltchev
What is the version of the NCPA agent that you are running on the AIX system?

It is possible that the OSError: [Errno 13] Permission denied error is caused by the NCPA's inability to deal with a NFS share. See these posts:

https://github.com/NagiosEnterprises/ncpa/issues/372

https://github.com/NagiosEnterprises/ncpa/issues/368

If you are not running the latest version of the NCPA agent, I would recommend upgrading the agent.

If after upgrading you are still having problems, we would need to escalate the issue to our developers by filing an official bug report on GitHub.

Re: Nagios Agent(NCPA) permission issue in AIX servers

Posted: Tue Apr 10, 2018 10:32 pm
by muadba
Hi,

My ncpa version is 2.1.1. From the download page it seems to be the latest version.

Could you please check and advise ?

=================
bash-4.2$ rpm -qa | grep ncpa
ncpa-2.1.1-1
bash-4.2$
=================

Re: Nagios Agent(NCPA) permission issue in AIX servers

Posted: Tue Apr 10, 2018 11:54 pm
by muadba
Hi,

I have checked in servers and could see that only in one server we have nfs mount. In other 8 servers we dont have nfs and still facing same issue. Could you please advise ?

Also I have noticed that the filesystem type of cifs, nfs etc are already excluded in the configuration file:

===================
# Excluded file system types removes these fs types from the disk metrics
# (This is mostly only noteable on UNIX systems but also works on Windows if you need it)
# Default: aufs,autofs,binfmt_misc,cifs,cgroup,debugfs,devpts,devtmpfs,encryptfs,
# efivarfs,fuse,hugelbtfs,mqueue,nfs,overlayfs,proc,pstore,rpc_pipefs,
# securityfs,smb,sysfs,tmpfs,tracefs
#
exclude_fs_types = aufs,autofs,binfmt_misc,cifs,cgroup,debugfs,devpts,devtmpfs,encryptfs,efivarfs,fuse,hugelbtfs,mqueue,nfs,overlayfs,proc,pstore,rpc_pipefs,securityfs,
smb,sysfs,tmpfs,tracefs
===================

Re: Nagios Agent(NCPA) permission issue in AIX servers

Posted: Wed Apr 11, 2018 10:00 am
by jomann
It looks like it is trying to read from /etc/mnttab, what do the permissions look like on there? Specifically I am referring to https://github.com/giampaolo/psutil/blo ... aix.c#L429 this line in the psutils AIX module.