AIX server 7.2 permission denied error nagiosxi

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mejokj
Posts: 353
Joined: Mon Jul 22, 2013 10:31 pm

AIX server 7.2 permission denied error nagiosxi

Post by mejokj »

Hi Team,

We have tried to add AIX server 7.2 to Nagioxi using check_by_ssh plugin. But we are getting the below permission issue.

Error
++++

[nagios@fujams01 ~]$ /usr/local/nagios/libexec/check_by_ssh -H drcoreflsh01 -C /usr/local/nagios/libexec/check_disk
Remote command execution failed: ksh: /usr/local/nagios/libexec/check_disk: 0403-006 Execute permission denied.

Please check and advise on this issue.

Followed the same document mentioned below.

https://assets.nagios.com/downloads/nag ... ng_SSH.pdf

Note: We are able to do passwordless authentication to remote server and the command /usr/local/nagios/libexec/check_by_ssh -H remoteip -C uptime works fine.


Remote AIX Server file permissions
+++++++++++++++++++++++++++++

root@drcoreflsh01:/home/nagios # ls -ltr
total 1656

-rwxrwxr-x 1 nagios staff 157552 Feb 25 2019 check_users
-rwxrwxr-x 1 nagios staff 223992 Feb 25 2019 check_procs
-rwxrwxrwx 1 nagios staff 227160 Feb 25 2019 check_disk
-rwxrwxrwx 1 nagios staff 214424 Feb 25 2019 check_by_ssh
-rwxr----- 1 nagios staff 254 Jun 20 09:11 .profile
drwx------ 2 nagios staff 256 Jun 20 09:17 .ssh
-rwxr-xr-x 1 nagios staff 2835 Jun 20 14:14 check_AIX_disk.sh
-rw------- 1 nagios staff 209 Jun 20 14:31 .bash_history
-rw------- 1 nagios staff 418 Jun 20 14:31 .sh_history
root@drcoreflsh01:/home/nagios #

Thanks,
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: AIX server 7.2 permission denied error nagiosxi

Post by cdienger »

You provided a directory listing of /home/nagios but the plugin would be found in /usr/local/nagios/libexec/check_disk on the AIX machine. Please get a directory listing of that. I'd also like to see a copy of the /usr/local/nagios/libexec/check_disk as well. It looks like it is trying to run ksh - is this shell available on the AIX system? A check_disk script using bash can be found at https://support.nagios.com/forum/viewto ... 16&t=40948 if you'd like to test that.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mejokj
Posts: 353
Joined: Mon Jul 22, 2013 10:31 pm

Re: AIX server 7.2 permission denied error nagiosxi

Post by mejokj »

Hi,

Please find below the file listings under libexec directory.

root@drcoreflsh01:/usr/local/nagios/libexec # ls -ltr

total 1968

-rwxrwxr-x 1 nagios staff 157552 Feb 25 2019 check_users
-rwxrwxr-x 1 nagios staff 223992 Feb 25 2019 check_procs
-rwxrwxr-x 1 nagios staff 227160 Feb 25 2019 check_disk_old_23june2020
-rwxrwxr-x 1 nagios staff 214424 Feb 25 2019 check_by_ssh
-rw-r--r-- 1 root system 153544 Mar 17 10:14 dos2unix-7.4.0-1.aix5.1.ppc.rpm
-rwxr-xr-x 1 nagios staff 6016 Jun 23 10:46 check_disk
-rwxr-xr-x 1 nagios staff 2878 Jun 23 11:19 check_cpu
-rwxr-xr-x 1 nagios staff 4893 Jun 23 11:35 check_filesystems

==================================================================================
We have copied these files directly from nagios xi server, it was available by default in nagios xi server. Please see below the file format used.

root@drcoreflsh01:/usr/local/nagios/libexec # file check_users
check_users: ELF 64-bit LSB version 1 executable
root@drcoreflsh01:/usr/local/nagios/libexec # file check_procs
check_procs: ELF 64-bit LSB version 1 executable
root@drcoreflsh01:/usr/local/nagios/libexec # file check_disk_old_23june2020
check_disk_old_23june2020: ELF 64-bit LSB version 1 executable
root@drcoreflsh01:/usr/local/nagios/libexec # file check_by_ssh
check_by_ssh: ELF 64-bit LSB version 1 executable

=======================================================================================
Default shell used is ksh for all users

root@drcoreflsh01:/usr/local/nagios/libexec # lsuser -f root | grep -i shell
shell=/usr/bin/ksh
root@drcoreflsh01:/usr/local/nagios/libexec # lsuser -f nagios | grep -i shell
shell=/usr/bin/ksh

=======================================================================================

We have used the check_disk script using bash from viewtopic.php?f=16&t=40948 . It works fine and provided us the expected output.

root@drcoreflsh01:/usr/local/nagios/libexec # file check_disk
check_disk: shell script

[nagios@fujams01 ~]$ /usr/local/nagios/libexec/check_by_ssh -H drcoreflsh01 -C '/usr/local/nagios/libexec/check_disk 80 85 /opt'

OK: '/opt' is at 33% capacity, total 4.0GB, used 1.3GB (32.9%), free 2.7GB (67.1%) | 'used space'=2760440B;6710886;7130316;0;8388608 'used space (pct.)'=32.9%;80;85;0;100

Do we have similar type of plugins which can provide cpu usage, users,procs etc.

Please suggest

Thanks
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: AIX server 7.2 permission denied error nagiosxi

Post by cdienger »

The plugins being copied over is going to be the problem. The plugins were compiled for a different system. You'll need to compile them for/on the AIX system.

The source can be downloaded from https://nagios-plugins.org/.

Another option is to use scripts instead of compiling binaries.

The exchange will have some plugins:

https://exchange.nagios.org/directory/P ... ystems/AIX

as does the NRPE agent(https://assets.nagios.com/downloads/nag ... ent.tar.gz). I've attached the plugins that come with this agent.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mejokj
Posts: 353
Joined: Mon Jul 22, 2013 10:31 pm

Re: AIX server 7.2 permission denied error nagiosxi

Post by mejokj »

Issue sorted out. Please close the thread

Thank you very much for your inputs.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: AIX server 7.2 permission denied error nagiosxi

Post by scottwilkerson »

mejokj wrote:Issue sorted out. Please close the thread

Thank you very much for your inputs.
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked