Home Directory Plugins Databases SQLServer MSSQL Job Monitoring

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

MSSQL Job Monitoring Popular

Rating
24 votes
Favoured:
4
Current Version
0.1.1
Last Release Date
2010-07-25
Compatible With
  • Nagios 3.x
Owner
Hits
1382516
Files:
FileDescription
mssqljob.zipMSSQL Job Monitoring plugin , Source code and Documentation
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
The MSSQL Job Monitoring is designed to monitor sql jobs. The main reason for doing this, this plugin pulls information on Job Details such as Job Name, step name, Current Status, Last Run Status, server, message. This information about Jobs Details allows DBAs to identify if automated tasks are executed properly as planned. This saves DBAs a lot of time and effort instead of monitoring them manually.
1.Download mssqljob.zip extract that file.Folder contains SqlJobMon.class, url.properties, check_sqljob.sh sqljdbc.jar, MSSQL_JOB.doc, a folder which consists of java source code.
2. Copy files SqlJobMon.class,url.properties,check_sqljob.sh and sqljdbc.jar into libexec directory(eg /usr/local/nagios/libexec).

3. Edit the check_sqljob.sh file and set CLASSPATH corresponding to where you put class file SqlJobMon.class and sqljdbc.jar on your machine.

4. Edit url.properties file and set HTML_DIR and HTML_LINK corresponding to nagios share folder on your machine.
(eg: HTML_DIR=/usr/local/nagios/share/ HTML_LINK=/nagios/sqllog). This file consists of where to create html file and HTML link for plugin output.

sample usage of the plugin
--------------------------
sh check_sqljob.sh -H 10.25.5.115 -u Nagios -p Fefr6dre

plugin output will be
CRITICAL: Number of Jobs Failed:9|count=9

sh check_sqljob.sh -h
Usage: check_sqljob.sh -H hostaddress -u {username} -p {password}
-h for help
-H (hostaddress)
-u (username)
-p (password)
Example command
check_sqljob -H 10.70.5.45 -u sa -p s22css
Reviews (13)
The plugin functions as intended but there are some unnecessary features that I would like to disable. Overall the configurability is lacking.
bygtown1_sj, November 8, 2013
I am running core 3.5.1 on SLES 11 SP3 and the HTML ref is not working properly. It gets the info manually but not from service.

Manually -
sudo -u nagios /usr/lib/nagios/plugins/check_sqljob.sh -H -u user -p passwd
OK: Number of Jobs Failed:0|count=0

Nagios run:
usherdbt02;Failed Jobs;OK;SOFT;2; OK: Number of Jobs Failed:0

The link is also bad in Nagios:
http://nagios/nagios/cgi-bin/null/-2013-11-08.html

Any ideas? what am I missing?
by, June 14, 2013
Very good afternoon my name is Osman Panama writing from the truth I have a little problem, I have set up a nagios 3.2.1 on my system I have all monitoring well but I was asked to configure SQL server 2008 jobs I've seen on the website of nagios some cases but honestly I could not give the matter would like to know is can you give me a step by step that I must put in where and what should I set

thank you very much
bybbradley, August 16, 2012
I can get this plugin to run from a command line all day long under the nagios and root user but when I set it up in nagiosxi and returns unknown every time. What am I missing?
byL0cayta, July 10, 2012
Getting this error when running the plugin.

java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/local/nagios/libexec/,file:/usr/local/nagios/libexec/sqljdbc.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.10)
at java.lang.ClassLoader.loadClass(libgcj.so.10)
at java.lang.ClassLoader.loadClass(libgcj.so.10)
at java.lang.Class.forName(libgcj.so.10)
at SqlJobMon.main(SqlJobMon.java:97)
UNKNOWN:
byjetole, December 5, 2011
If you're getting the error

: bad variable nameH

This is because it's a Windows formatted file. Not sure how a Windows formatted bash script came to exist anywhere but there is one in this release. The difference is that Linux and Unix (which includes Mac OSX) use \n for newlines in their text files while Windows uses \r\n for new lines in their text files.

To convert the file to unix format you can use the command fromdos or on some systems, the older command dos2unix.

...or you could try out my much simpler Python check I wrote to do the same thing as this script and more without requiring compiled Java binaries in order to work. It's a simple, single, Python script with no other files combined with it that you can get from either:

http://exchange.nagios.org/directory/Plugins/Databases/SQLServer/MSSQL-Job-History/details

or

https://github.com/jetole/MSSQL-Job-History

Doesn't require Java. Doesn't have Windows line endings, provides more options and gives more detailed reports.
bylogoldman, November 4, 2011
Running on Ubuntu:

I can't use this plugin.
I can't run this command:
sh check_sqljob -h

Because this wrote:

: bad variable nameH

Can you help me?

Thanks
byKhoneini, November 22, 2010
Hi muthu,
First of all, really thanks for sharing this script with us. I'm trying to rewrite the java source so I can specify a Job name instead of all job names of a MSSQL server.
I'm stuck on some parts of the java source code, mind helping me out? You can contact me on sjorrs[at]gmail.com ofcourse I will share the source after it is working!
Cheers!
bymad12, November 10, 2010
2 of 3 people found this review helpful
running command from console plug-in work fine
after service definition plugin go into "unknown" status
Can someone help me????
Owner's reply

Edit check_sqljob.sh script and replace javacmd=`which java`
with actual path of java
below is an example
javacms=/usr/local/java/bin/java

byhjolli, September 22, 2010
Is it not possible to use windows Auth with this plugin ? we only run our servers with Windows authentication

ps on the current version I had to do dos2ux for the check_sqljob.sh to even run
I can't use this plugin.
I can't run this command:
sh check_sqljob -h

Because this wrote:

: bad variable nameH

Can you help me?

thanks

Peter
bylausser, July 22, 2010
0 of 2 people found this review helpful
It's a few lines shell script around binary java files hiding the core functionality. Any chance to see the source code? I won't let this connect to my databases and do whatever without having the slightest idea what's inside.
Owner's reply

Hi
yes its open source, i shared the source code mssqljob.zip file. Because i am changing some of the logic. So that i did not shared the code. I tested thoroughly last week its working fine for me. I included a design and installation document with that zip file.

bymadhusudhan, June 9, 2010
0 of 1 people found this review helpful
This one just works fine..... Hats off!!
Owner's reply

Thanks lot