Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
MSSQL Job Monitoring Popular
0.1.1
2010-07-25
- Nagios 3.x
1382016
File | Description |
---|---|
mssqljob.zip | MSSQL Job Monitoring plugin , Source code and Documentation |
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!
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
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)
byjshipe, March 5, 2014
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?
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?
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
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:
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.
: 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
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!
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!
running command from console plug-in work fine
after service definition plugin go into "unknown" status
Can someone help me????
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
ps on the current version I had to do dos2ux for the check_sqljob.sh to even run
bybigpeti_nagios, August 22, 2010
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
I can't run this command:
sh check_sqljob -h
Because this wrote:
: bad variable nameH
Can you help me?
thanks
Peter
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.
This one just works fine..... Hats off!!
Owner's reply
Thanks lot