check_mssql_health doesn't run as nagios user

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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_mssql_health doesn't run as nagios user

Post by ssax »

Sounds good, it's usually better to install perl modules with yum, it makes upgrading a lot easier because yum doesn't know about perl modules installed with cpan.
Goodie
Posts: 9
Joined: Thu Jun 11, 2015 6:51 am

Re: check_mssql_health doesn't run as nagios user

Post by Goodie »

Hi ssax,

I tried compileing the plugin again as you suggested however, I get the same error.

I then tried to install Sybase from yum, however, I got the below error

Code: Select all

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.muzzy.org.uk
 * epel: www.mirrorservice.org
 * extras: mirror.as29550.net
 * updates: mirror.as29550.net
No package perl-DBD-Sybase available.
Error: Nothing to do
Is there away to remove the cpan Sybase and install from yum? do I need to add another repo to install Sybase from yum? I had a nightmare installing Sybase the first time round!

Thanks for the help
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_mssql_health doesn't run as nagios user

Post by lmiltchev »

This package should be available from the rpmforge repo...

Code: Select all

yum search perl | grep Sybase
perl-DBD-Sybase.x86_64 : Perl module named DBD-Sybase

Code: Select all

yum provides perl-DBD-Sybase
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.us.leaseweb.net
 * epel: mirror.steadfast.net
 * extras: mirror.raystedman.net
 * rpmforge: mirror.nexcess.net
 * updates: ftpmirror.your.org
perl-DBD-Sybase-1.10-1.el6.rf.x86_64 : Perl module named DBD-Sybase
Repo        : rpmforge
What is the output of the following command?

Code: Select all

yum repolist -v
Be sure to check out our Knowledgebase for helpful articles and solutions!
Goodie
Posts: 9
Joined: Thu Jun 11, 2015 6:51 am

Re: check_mssql_health doesn't run as nagios user

Post by Goodie »

Hi,

Running `yum search perl | grep Sybase` doesn't return anything, see below

Code: Select all

[root@9-srv-nagios downloads]# yum search perl | grep Sybase
[root@9-srv-nagios downloads]#
I have installed the rpmforge repo by following the below link for x64 CentoOS 7
http://www.tecmint.com/enable-rpmforge-repository/

When tring to install Sybase I got the below error `nothing to do`

Code: Select all

[root@9-srv-nagios downloads]# yum install perl-DBD-Sybase                      Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.as29550.net
 * epel: www.mirrorservice.org
 * extras: mirror.simwood.com
 * rpmforge: www.mirrorservice.org
 * updates: mirror.as29550.net
No package perl-DBD-Sybase available.
Error: Nothing to do
the results from running `yum repolist -v` are below

Code: Select all

[root@9-srv-nagios downloads]# yum repolist -v
Loading "fastestmirror" plugin
Config time: 0.008
Yum version: 3.4.3
Loading mirror speeds from cached hostfile
 * base: mirror.as29550.net
 * epel: www.mirrorservice.org
 * extras: mirror.simwood.com
 * rpmforge: www.mirrorservice.org
 * updates: mirror.as29550.net
Setting up Package Sacks
pkgsack time: 0.008
Repo-id      : base/7/x86_64
Repo-name    : CentOS-7 - Base
Repo-revision: 1427842153
Repo-updated : Tue Mar 31 23:50:46 2015
Repo-pkgs    : 8,652
Repo-size    : 6.3 G
Repo-mirrors : http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock
Repo-baseurl : http://mirror.as29550.net/mirror.centos.org/7.1.1503/os/x86_64/
             : (9 more)
Repo-expire  : 21,600 second(s) (last: Wed Jun 17 09:08:24 2015)
Repo-filename: /etc/yum.repos.d/CentOS-Base.repo

Repo-id      : epel/x86_64
Repo-name    : Extra Packages for Enterprise Linux 7 - x86_64
Repo-revision: 1434217867
Repo-tags    : binary-x86_64
Repo-updated : Sat Jun 13 18:53:13 2015
Repo-pkgs    : 8,076
Repo-size    : 5.6 G
Repo-metalink: https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=x86_64
  Updated    : Sat Jun 13 18:53:13 2015
Repo-baseurl : http://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/epel/7/x86_64/
             : (67 more)
Repo-expire  : 21,600 second(s) (last: Wed Jun 17 09:08:37 2015)
Repo-filename: /etc/yum.repos.d/epel.repo

Repo-id      : extras/7/x86_64
Repo-name    : CentOS-7 - Extras
Repo-revision: 1432315092
Repo-updated : Fri May 22 18:19:02 2015
Repo-pkgs    : 128
Repo-size    : 464 M
Repo-mirrors : http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock
Repo-baseurl : http://mirror.simwood.com/centos/7.1.1503/extras/x86_64/ (9 more)
Repo-expire  : 21,600 second(s) (last: Wed Jun 17 09:08:38 2015)
Repo-filename: /etc/yum.repos.d/CentOS-Base.repo

Repo-id      : rpmforge
Repo-name    : RHEL 7 - RPMforge.net - dag
Repo-updated : Fri Jul 11 02:46:42 2014
Repo-pkgs    : 245
Repo-size    : 198 M
Repo-baseurl : http://apt.sw.be/redhat/el7/en/x86_64/rpmforge/
Repo-mirrors : http://mirrorlist.repoforge.org/el7/mirrors-rpmforge
Repo-expire  : 21,600 second(s) (last: Wed Jun 17 09:08:45 2015)
Repo-filename: /etc/yum.repos.d/rpmforge.repo

Repo-id      : updates/7/x86_64
Repo-name    : CentOS-7 - Updates
Repo-revision: 1434398283
Repo-updated : Mon Jun 15 20:58:42 2015
Repo-pkgs    : 673
Repo-size    : 1.8 G
Repo-mirrors : http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=stock
Repo-baseurl : http://mirror.as29550.net/mirror.centos.org/7.1.1503/updates/x86_64/
             : (9 more)
Repo-expire  : 21,600 second(s) (last: Wed Jun 17 09:08:46 2015)
Repo-filename: /etc/yum.repos.d/CentOS-Base.repo

repolist: 17,774

Thanks
Goodie
Posts: 9
Joined: Thu Jun 11, 2015 6:51 am

Re: check_mssql_health doesn't run as nagios user

Post by Goodie »

Thanks for the help, I've resolved the issue.

I rolled back the VM to a time before I attempted to configure the check_mssql_health plugin, I added the nagios user to the suders file and then installed/configured the plugin and prerequisites as nagios using the sudo command.

Thanks again.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_mssql_health doesn't run as nagios user

Post by tmcdonald »

Sounds good(ie)! I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked