Issue displaying the OUTPUT

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
haile711
Posts: 197
Joined: Thu May 28, 2015 7:36 am

Issue displaying the OUTPUT

Post by haile711 »

Hey guys,

I have an issue with displaying the data output on one of my nagios box.

As you can see in the attachment pictures.

It can echo in the nagios console but not from the nagios web browser. I have the same script, working on another server.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Issue displaying the OUTPUT

Post by ssax »

Because your screenshots are cut off I'm not able to see if those boxes scroll or not. What is the exact problem, is it not displaying all the data (getting cut off) or is it just not displaying the way you want it? Please be more specific.

Thank you
haile711
Posts: 197
Joined: Thu May 28, 2015 7:36 am

Re: Issue displaying the OUTPUT

Post by haile711 »

good morning ssax,

sorrry for not being more specific, but as you can see from the pictures top pictures it's displaying the F5 pools stats, like connection policy, packet in and out, etc.. (on another nagios box, with the exact script). On the middle pictures it's only displaying the pool but no stats, and the bottom picture is from the nagios terminal it's does display the pool stats, but when I try to test it from the nagios browser (service) it's only displaying the pool. Does this make sense

P.S these are the exact script runnin on 2 different nagios box, with the same version.

Thanks
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Issue displaying the OUTPUT

Post by ssax »

Please SSH into the XI server and run these commands and post the results:

Code: Select all

su - nagios
/usr/local/nagios/libexec/check_mcom_f5_pool_stat.sh
cd /usr/local/nagios/libexec
./check_mcom_f5_pool_stat.sh
I want to see if it's any different for the nagios user and also if it matters what directory you're in.


Thank you
haile711
Posts: 197
Joined: Thu May 28, 2015 7:36 am

Re: Issue displaying the OUTPUT

Post by haile711 »

ssax,

here is the output

Code: Select all

[nagios@ma209dlvmon835 libexec]$ ./check_mcom_f5_pool_stat.sh
Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
Dyces_IHS_443

Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
Dyces_IHS_80

Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
NavApp

Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
NavAppBot

Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
StoreServers

Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
bops_ihs_447

Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
bops_ihs_85

Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
One question, how come I cannot see this error "Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 ." under root but we can under nagios user?

Code: Select all

[root@ma209dlvmon835 libexec]# find / -name Plugin.pm
/usr/local/share/perl5/Monitoring/Plugin.pm
/usr/local/share/perl5/Nagios/Monitoring/Plugin.pm
/usr/local/share/perl5/Nagios/Plugin.pm
/root/.cpan/build/Nagios-Plugin-0.990001-50hYuz/lib/Nagios/Plugin.pm
/root/.cpan/build/Nagios-Plugin-0.990001-HmWvAr/lib/Nagios/Plugin.pm
/root/.cpan/build/Monitoring-Plugin-0.39-p3qBrp/blib/lib/Monitoring/Plugin.pm
/root/.cpan/build/Monitoring-Plugin-0.39-p3qBrp/lib/Monitoring/Plugin.pm
/root/.cpan/build/Nagios-Plugin-0.990001-B8ZbAy/lib/Nagios/Plugin.pm
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Issue displaying the OUTPUT

Post by ssax »

Likely because of different environmental variables/perl @INC, no TTY, different user when running Test Check Command button, etc.

Please attach this file:

Code: Select all

/usr/local/nagios/libexec/check_mcom_f5_pool_stat.sh
What are the permissions on the file/folder?

Code: Select all

ls -ld /usr/local/share/perl5
ls -ld /usr/local/share/perl5/Nagios
ls -l /usr/local/share/perl5/Nagios/Plugin.pm
Thank you
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Issue displaying the OUTPUT

Post by tgriep »

It is a permission issue. The root user can access the file and or the folder the perl module is in and the nagios user cannot.
Try running this to change the permissions and see if the errors go away.

Code: Select all

chmod -R ugo+rw /usr/local/share/perl5/Nagios
Be sure to check out our Knowledgebase for helpful articles and solutions!
haile711
Posts: 197
Joined: Thu May 28, 2015 7:36 am

Re: Issue displaying the OUTPUT

Post by haile711 »

tgriep, ssax

I have changed the permission based on tgriep
but still getting the issue

Code: Select all

[root@ma209dlvmon835 perl5]# ls -ld /usr/local/share
drwxr-xr-x 7 root root 4096 Aug 18 14:19 /usr/local/share
[root@ma209dlvmon835 perl5]# ls -ld /usr/local/share/perl5/
drwxr-xr-x 12 root root 4096 Mar 17 10:41 /usr/local/share/perl5/
[root@ma209dlvmon835 perl5]# ls -ld /usr/local/share/perl5/Nagios/
drw-rw-rw- 4 root root 4096 Feb 19 12:01 /usr/local/share/perl5/Nagios/
[root@ma209dlvmon835 perl5]# ls -ld /usr/local/share/perl5/Nagios/Plugin
drw-rw-rw- 2 root root 4096 Feb 19 12:01 /usr/local/share/perl5/Nagios/Plugin
[root@ma209dlvmon835 perl5]# ls -ld /usr/local/share/perl5/Nagios/Plugin.pm
-rw-rw-rw- 1 root root 18859 Jun  5  2009 /usr/local/share/perl5/Nagios/Plugin.pm
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Issue displaying the OUTPUT

Post by lmiltchev »

In Linux, the execute bit on directories allows the affected user to enter the directory, and access files and directories inside. Try running the following commands to change permissions one more time:

Code: Select all

chmod -R o+x /usr/local/share/perl5/Nagios
Let us know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
haile711
Posts: 197
Joined: Thu May 28, 2015 7:36 am

Re: Issue displaying the OUTPUT

Post by haile711 »

hey lmiltchev,

I have changed the permission as u suggested but still getting the same error

Code: Select all

Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_f5_ltm_pool.pl line 24.
mchub_ordermanagement_81_pool

Code: Select all

[root@ma209dlvmon835 ~]# ls -lrt /usr/local/share/perl5/Nagios/
total 28
-rw-rw-rwx 1 nagios nagios 18859 Jun  5  2009 Plugin.pm
drw-rw-rwx 3 nagios nagios  4096 Feb 19 11:49 Monitoring
drw-rw-rwx 2 nagios nagios  4096 Feb 19 12:01 Plugin
Locked