MSSQL using NSClient++

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
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: MSSQL using NSClient++

Post by ofadl »

what is the syntax to displace output?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: MSSQL using NSClient++

Post by slansing »

Just like you are doing in your other thread, except use this command, "of course you need to fill in the ARG sections, and the hostaddress yourself:"

Code: Select all

/usr/lib/nagios/plugins/check_mssql_sproc.pl -H $HOSTADDRESS$ -p "sp_CheckCoreLastDeliveredBusHours" -u sa -P "dusT#Controle" -w $ARG1$ -c $ARG2$
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: MSSQL using NSClient++

Post by ofadl »

ok so i just tried this :

/usr/lib/nagios/plugins/check_mssql_sproc.pl -H 10.200.50.176 -p "sp_CheckCoreLastDeliveredBusHours" -u sa -P "dusT#Controle" -w 1 -c 2

and got this:

install_driver(ODBC) failed: Can't locate DBD/ODBC.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at (eval 3) line 3.
Perhaps the DBD::ODBC perl module hasn't been fully installed,
or perhaps the capitalisation of 'ODBC' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge, mysql.
at /usr/lib/nagios/plugins/check_mssql_sproc.pl line 68
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: MSSQL using NSClient++

Post by slansing »

Please install the following as google says, and then try the command again, we're getting closer!:

Code: Select all

yum install perl-DBD-ODBC
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: MSSQL using NSClient++

Post by ofadl »

im using ubuntu and coudlnt do :

sudo apt-get install perl-DBD-ODBC
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: MSSQL using NSClient++

Post by abrist »

Try:

Code: Select all

apt-get install libdbd-odbc-perl
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: MSSQL using NSClient++

Post by ofadl »

alright, i installed that program and ran this again:

/usr/lib/nagios/plugins/check_mssql_sproc.pl -H 10.200.50.176 -p "sp_CheckCoreLastDeliveredBusHours" -u sa -P "dusT#Controle" -w 1 -c 2

and got this:

DBI connect('Driver={SQL Server};SERVER=10.200.50.176','sa',...) failed: [unixODBC][Driver Manager]Data source name not found, and no defa ult driver specified (SQL-IM002) at /usr/lib/nagios/plugins/check_mssql_sproc.pl line 68
Error: Unable to connect to MS-SQL database!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: MSSQL using NSClient++

Post by abrist »

Check the comments at the bottom of the exchange page:
http://exchange.nagios.org/directory/Pl ... oc/details
Good But...
bydcoote, April 19, 2011
I must admit I haven't tested thoroughly but I did wrestle for hours before finding out.

A quick change is required to make this work on *nix systems. Damn case sensitive.

For *nix systems
$conn{"dsn"} = "dbi:ODBC:Driver={SQL Server};SERVER=" . $conn{"server"};

Should read
$conn{"dsn"} = "dbi:ODBC:DRIVER={SQL Server};SERVER=" . $conn{"server"};
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: MSSQL using NSClient++

Post by ofadl »

whats a nix system? im confused
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: MSSQL using NSClient++

Post by slansing »

Unix/Linux "Unix like," let us know if you observe a change after modifying the line shown.
Locked