Page 5 of 9

Re: MSSQL using NSClient++

Posted: Fri Jun 28, 2013 10:28 am
by ofadl
what is the syntax to displace output?

Re: MSSQL using NSClient++

Posted: Fri Jun 28, 2013 10:32 am
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$

Re: MSSQL using NSClient++

Posted: Fri Jun 28, 2013 10:40 am
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

Re: MSSQL using NSClient++

Posted: Fri Jun 28, 2013 10:52 am
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

Re: MSSQL using NSClient++

Posted: Fri Jun 28, 2013 11:15 am
by ofadl
im using ubuntu and coudlnt do :

sudo apt-get install perl-DBD-ODBC

Re: MSSQL using NSClient++

Posted: Fri Jun 28, 2013 2:45 pm
by abrist
Try:

Code: Select all

apt-get install libdbd-odbc-perl

Re: MSSQL using NSClient++

Posted: Fri Jun 28, 2013 2:54 pm
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!

Re: MSSQL using NSClient++

Posted: Mon Jul 01, 2013 10:27 am
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"};

Re: MSSQL using NSClient++

Posted: Mon Jul 01, 2013 11:11 am
by ofadl
whats a nix system? im confused

Re: MSSQL using NSClient++

Posted: Mon Jul 01, 2013 11:12 am
by slansing
Unix/Linux "Unix like," let us know if you observe a change after modifying the line shown.