External Plugins Not working

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

External Plugins Not working

Post by nathanplatt »

Hi Guys,

I just migrated Nagios from Ubuntu to Centos and have had a few problems, here are the ones that aren't playing;
(No output on stdout) stderr: Can't locate Net/SNMP.pm in @INC (@INC contains: /usr/local/nagios/libexec /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-netapp-ng.pl line 40.

UNKNOWN: check_snmp_printer: No usable 'bc' binary in '/sbin:/usr/sbin:/bin:/usr/bin'

(No output on stdout) stderr: Can't locate Net/SNMP.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_qnapdisk line 25
So in an attempt to fix this, i installed CPAN and ran the following;

cpan install Monitoring::Plugin
yum install perl-Nagios-Plugin

Then i restarted nagios and httpd, but i'm still getting the errors. Any help would be appreciated
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: External Plugins Not working

Post by nathanplatt »

Right, i've managed to fix almost all of these, but i'm stuck in two areas:

Nagios Graphs.

I have the following error

JavaScript is disabled.
nagiosgraph.js is not installed or wrong version.

The rrd files are collating, the config seems fine, the js file is located in /usr/local/nagiosadmin/share/

And check_snmp_printer;

UNKNOWN: check_snmp_printer: No usable 'bc' binary in '/sbin:/usr/sbin:/bin:/usr/bin'
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: External Plugins Not working

Post by tgriep »

You can run this to install bc on your server to fix that issue.

Code: Select all

yum install bc -y
Take a look at this like for help on the nagiosgraph issue.
https://sourceforge.net/p/nagiosgraph/d ... /5cfbb6ee/
Be sure to check out our Knowledgebase for helpful articles and solutions!
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: External Plugins Not working

Post by nathanplatt »

Okay, so i installed bc and then it said I was missing xxd, so i googled and installed vim-common and vim-enhanced, now all those items have disappeared from Nagios completely.

As for the issues with nagiosgraph.

I moved the js and css to the nagios/share folder and the graph now shows but i'm still getting the same errors at the top. If i navigate to a host graph directly it works but I can't choose the servers from the how.cgi menu.

Any other ideas?

Nathan
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: External Plugins Not working

Post by nathanplatt »

nathanplatt wrote:Okay, so i installed bc and then it said I was missing xxd, so i googled and installed vim-common and vim-enhanced, now all those items have disappeared from Nagios completely.

As for the issues with nagiosgraph.

I moved the js and css to the nagios/share folder and the graph now shows but i'm still getting the same errors at the top. If i navigate to a host graph directly it works but I can't choose the servers from the how.cgi menu.

Any other ideas?

Nathan
Okay, so i've fixed the external files, but the graphs still aren't working.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: External Plugins Not working

Post by tgriep »

Can you screen capture what the issue is and post it here so we can view it?
Have you searched here to see if there is a fix for the issue?
https://sourceforge.net/p/nagiosgraph/discussion/394748
Be sure to check out our Knowledgebase for helpful articles and solutions!
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: External Plugins Not working

Post by nathanplatt »

You can see from the attachment that the graph is loading and working, but I keep getting the error at the top.

I have the nagiosgraph.js and css file located in the /usr/local/nagios/share/ folder, when i moved them there i can see the graphs but the error appears still.

I ls -l on the folder and found that both the nagiosgraph files where root root, so i've chown them to nagios:nagios but i still get the error.

This is the same error, but there's no solution https://sourceforge.net/p/nagiosgraph/d ... /e7e3d3ba/

The nagiosgraph.conf file has the following;

Code: Select all

# JavaScript: URL to the nagiosgraph javascript file.
javascript = /usr/local/nagios/share/nagiosgraph.js

# Stylesheet: URL to the nagiosgraph stylesheet.
stylesheet = /usr/local/nagios/share/nagiosgraph.css
I'm guessing the config is really messed up, here is the report from showconfig.cfg

Code: Select all




CONTEXT_DOCUMENT_ROOT=/usr/local/nagiosgraph/sbin
CONTEXT_PREFIX=/nagiosgraph/cgi-bin
DOCUMENT_ROOT=/var/www/html
GATEWAY_INTERFACE=CGI/1.1
HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODING=gzip, deflate
HTTP_ACCEPT_LANGUAGE=en-GB,en;q=0.5
HTTP_CONNECTION=keep-alive
HTTP_HOST=nagios.ramsdensfinancial.co.uk
HTTP_USER_AGENT=Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
QUERY_STRING=
REMOTE_ADDR=192.168.1.254
REMOTE_PORT=62605
REQUEST_METHOD=GET
REQUEST_SCHEME=http
REQUEST_URI=/nagiosgraph/cgi-bin/showconfig.cgi
SCRIPT_FILENAME=/usr/local/nagiosgraph/sbin/showconfig.cgi
SCRIPT_NAME=/nagiosgraph/cgi-bin/showconfig.cgi
SCRIPT_URI=http://nagios.ramsdensfinancial.co.uk/nagiosgraph/cgi-bin/showconfig.cgi
SCRIPT_URL=/nagiosgraph/cgi-bin/showconfig.cgi
SERVER_ADDR=192.168.1.5
SERVER_ADMIN=root@localhost
SERVER_NAME=nagios.ramsdensfinancial.co.uk
SERVER_PORT=80
SERVER_PROTOCOL=HTTP/1.1
SERVER_SIGNATURE=
SERVER_SOFTWARE=Apache/2.4.6 (CentOS) PHP/5.4.16
UNIQUE_ID=VwerYZeZ@qfgOnxTxeOy@QAAAAs

Include Paths

/usr/local/nagiosgraph/etc/nagiosgraph
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
Here is the folder directory for /usr/local/nagiosgraph/etc/nagiosgraph/

Code: Select all

[root@nagios nagiosgraph]# ls -l
total 192
-rw-r--r--. 1 root root    879 Apr  6 10:40 access.conf
-rw-r--r--. 1 root root    873 Apr  6 10:40 datasetdb.conf
-rw-r--r--. 1 root root   2279 Apr  6 10:40 groupdb.conf
-rw-r--r--. 1 root root   1446 Apr  6 10:40 hostdb.conf
-rw-r--r--. 1 root root   1828 Apr  6 10:40 labels.conf
-rw-r--r--. 1 root root   9826 Apr  6 10:40 map
-rw-r--r--. 1 root root    454 Apr  8 13:56 nagiosgraph-apache.conf
-rw-r--r--. 1 root root    192 Apr  6 10:40 nagiosgraph-commands.cfg
-rw-r--r--. 1 root root  15387 Apr  8 13:59 nagiosgraph.conf
-rw-r--r--. 1 root root    793 Apr  6 10:40 nagiosgraph_de.conf
-rw-r--r--. 1 root root    865 Apr  6 10:40 nagiosgraph_es.conf
-rw-r--r--. 1 root root    935 Apr  6 10:40 nagiosgraph_fr.conf
-rw-r--r--. 1 root root    395 Apr  6 10:40 nagiosgraph-nagios.cfg
-rw-r--r--. 1 root root 114596 Apr  6 10:40 ngshared.pm
-rw-r--r--. 1 root root    660 Apr  6 10:40 rrdopts.conf
-rw-r--r--. 1 root root    480 Apr  6 10:40 servdb.conf
[root@nagios nagiosgraph]#

Here is the tree

Code: Select all

[root@nagios nagiosgraph]# tree
.
├── docs
│   └── nagiosgraph
│       ├── AUTHORS
│       ├── CHANGELOG
│       ├── examples
│       │   ├── graphed-host.cfg
│       │   ├── graphed-service.cfg
│       │   ├── graph.gif
│       │   ├── insert.sh
│       │   ├── map_1_3
│       │   ├── map_1_4_3
│       │   ├── map_1_4_4
│       │   ├── map_1_4_5
│       │   ├── map_examples
│       │   ├── map_minimal
│       │   ├── map_mwall
│       │   ├── nagiosgraph.1.css
│       │   ├── nagiosgraph.2.css
│       │   ├── nagiosgraph-apache.conf
│       │   ├── nagiosgraph-commands.cfg
│       │   ├── nagiosgraph-logrotate
│       │   ├── nagiosgraph-nagios.cfg
│       │   └── nagiosgraph.ssi
│       ├── INSTALL
│       ├── README
│       ├── TODO
│       └── util
│           ├── flat2hier.pl
│           └── testentry.pl
├── etc
│   └── nagiosgraph
│       ├── access.conf
│       ├── datasetdb.conf
│       ├── groupdb.conf
│       ├── hostdb.conf
│       ├── labels.conf
│       ├── map
│       ├── nagiosgraph-apache.conf
│       ├── nagiosgraph-commands.cfg
│       ├── nagiosgraph.conf
│       ├── nagiosgraph_de.conf
│       ├── nagiosgraph_es.conf
│       ├── nagiosgraph_fr.conf
│       ├── nagiosgraph-nagios.cfg
│       ├── ngshared.pm
│       ├── rrdopts.conf
│       └── servdb.conf
├── libexec
│   └── insert.pl
├── sbin
│   ├── export.cgi
│   ├── insert.pl
│   ├── show.cgi
│   ├── showconfig.cgi
│   ├── showgraph.cgi
│   ├── showgroup.cgi
│   ├── showhost.cgi
│   ├── showservice.cgi
│   └── testcolor.cgi
└── share
    ├── nagiosgraph.css
    └── nagiosgraph.js

9 directories, 53 files
And the nagios share folder

Code: Select all

[root@nagios share]# ls -l
total 204
drwxrwxr-x. 4 nagios nagios    85 Apr  5 15:27 angularjs
drwxrwxr-x. 3 nagios nagios    16 Apr  5 15:27 bootstrap-3.3.0
-rw-rw-r--. 1 nagios nagios   576 Apr  5 15:27 config.inc.php
drwxrwxr-x. 2 nagios nagios  4096 Apr  5 15:27 contexthelp
drwxrwxr-x. 2 nagios nagios    22 Apr  5 15:27 d3
drwxrwxr-x. 3 nagios nagios    19 Apr  5 15:27 docs
-rw-rw-r--. 1 nagios nagios   879 Apr  5 16:34 graph-header.html
-rw-rw-r--. 1 nagios nagios  4136 Apr  5 15:27 histogram-form.html
-rw-rw-r--. 1 nagios nagios  5579 Apr  5 15:27 histogram-graph.html
-rw-rw-r--. 1 nagios nagios  2855 Apr  5 15:27 histogram.html
-rw-rw-r--. 1 nagios nagios  2372 Apr  5 16:34 histogram-links.html
drwxrwxr-x. 3 nagios nagios  4096 Apr  5 16:34 images
drwxrwxr-x. 3 nagios nagios    62 Apr  5 15:27 includes
-rw-rw-r--. 1 nagios nagios  1653 Apr  5 15:27 index.php
-rw-rw-r--. 1 nagios nagios  1660 Apr  5 16:34 infobox.html
drwxrwxr-x. 2 nagios nagios  4096 Apr  5 15:27 js
-rw-rw-r--. 1 nagios nagios  1177 Apr  5 15:27 jsonquery.html
drwxr-xr-x. 4 root   root      24 Apr  5 15:49 locale
-rw-rw-r--. 1 nagios nagios  8745 Apr  5 16:34 main.php
-rw-rw-r--. 1 nagios nagios  1967 Apr  5 15:27 map-directive.html
-rw-rw-r--. 1 nagios nagios  3824 Apr  5 16:34 map-form.html
-rw-rw-r--. 1 nagios nagios  2627 Apr  5 15:27 map.html
-rw-rw-r--. 1 nagios nagios   623 Apr  5 15:27 map-links.html
-rw-rw-r--. 1 nagios nagios  1723 Apr  5 15:27 map-popup.html
drwxrwxr-x. 2 nagios nagios     6 Apr  5 15:27 media
-rwxr-xr-x. 1 nagios nagios  2626 Apr  7 10:54 nagiosgraph.css
-rwxr-xr-x. 1 nagios nagios 42865 Apr  7 10:54 nagiosgraph.js
-rw-rw-r--. 1 nagios nagios    26 Apr  5 16:34 robots.txt
-rw-rw-r--. 1 nagios nagios   657 Apr  5 15:27 rss-corebanner.php
-rw-rw-r--. 1 nagios nagios  1071 Apr  5 15:27 rss-corefeed.html
-rw-rw-r--. 1 nagios nagios   898 Apr  5 16:34 rss-corefeed.php
-rw-rw-r--. 1 nagios nagios   544 Apr  5 15:27 rss-newsfeed.html
-rw-rw-r--. 1 nagios nagios  1068 Apr  5 16:34 rss-newsfeed.php
-rw-rw-r--. 1 nagios nagios  6275 Apr  5 15:27 side.php
drwxrwxr-x. 2 nagios nagios    24 Apr  5 15:27 spin
drwxrwxr-x. 2 nagios nagios     6 Apr  5 15:27 ssi
drwxrwxr-x. 2 nagios nagios  4096 Apr  5 15:27 stylesheets
-rw-rw-r--. 1 nagios nagios  4243 Apr  5 16:34 trends-form.html
-rw-rw-r--. 1 nagios nagios  4256 Apr  5 15:27 trends-graph.html
-rw-rw-r--. 1 nagios nagios   852 Apr  5 16:34 trends-host-yaxis.html
-rw-rw-r--. 1 nagios nagios  2990 Apr  5 15:27 trends.html
-rw-rw-r--. 1 nagios nagios  3586 Apr  5 16:34 trends-links.html
-rw-rw-r--. 1 nagios nagios  1065 Apr  5 15:27 trends-service-yaxis.html
Hopefully that's everything you need. Sorry for such a long post
Attachments
screen grab.png
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: External Plugins Not working

Post by nathanplatt »

I've resolved this, i didn't realise that the value of Stylesheet and Javascript is the url not the path, changed this and its now working correctly

Please close
Locked