These definition can be placed in their own file or added to

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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: These definition can be placed in their own file or adde

Post by tmcdonald »

Also, was that all you modified? There should have been some files where you had to do things like define host { and define service { to get this working. Can you post those as well?
Former Nagios employee
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: These definition can be placed in their own file or adde

Post by lmiltchev »

Also, can you run the following command and show the output?

Code: Select all

file /path/to/check_sqljob.sh
Be sure to check out our Knowledgebase for helpful articles and solutions!
bmurtha
Posts: 27
Joined: Tue Feb 23, 2016 11:08 am

Re: These definition can be placed in their own file or adde

Post by bmurtha »

I got this from here: https://exchange.nagios.org/directory/P ... ng/details

Regards,
Bryan
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: These definition can be placed in their own file or adde

Post by Box293 »

What is the output of:

Code: Select all

cd /usr/local/nagios/libexec/
ls -la SqlJobMon.class url.properties check_sqljob.sh sqljdbc.jar
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
bmurtha
Posts: 27
Joined: Tue Feb 23, 2016 11:08 am

Re: These definition can be placed in their own file or adde

Post by bmurtha »

-rwxr-xr-x 1 root nagios 1656 Mar 8 15:04 check_sqljob.sh
-rw-r--r-- 1 root nagios 583286 Feb 24 16:11 sqljdbc.jar
-rwxr-xr-x 1 root nagios 7540 Mar 2 17:01 SqlJobMon.class
-rw-r--r-- 1 root nagios 68 Mar 7 09:39 url.properties
bmurtha
Posts: 27
Joined: Tue Feb 23, 2016 11:08 am

Re: These definition can be placed in their own file or adde

Post by bmurtha »

After chaning all the files to chmod 755 I get this as the output

Code: Select all

Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32          use a 32-bit data model if available
    -d64          use a 64-bit data model if available
    -client       to select the "client" VM
    -server       to select the "server" VM
    -hotspot      is a synonym for the "client" VM  [deprecated]
                  The default VM is client.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A : separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose:[class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -no-jre-restrict-search
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions with specified granularity
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions with specified granularity
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                  see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
./check_sqljob.sh: line 42: /usr/local/nagios/libexec/SqlJobMon.class: cannot execute binary file
UNKNOWN:
Last edited by tmcdonald on Wed Mar 09, 2016 11:10 am, edited 1 time in total.
Reason: Please use [code][/code] tags around long output
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: These definition can be placed in their own file or adde

Post by tmcdonald »

Can you please address our questions above?
hsmith wrote:Where did you get this script from?
tmcdonald wrote:Also, was that all you modified? There should have been some files where you had to do things like define host { and define service { to get this working. Can you post those as well?
Former Nagios employee
bmurtha
Posts: 27
Joined: Tue Feb 23, 2016 11:08 am

Re: These definition can be placed in their own file or adde

Post by bmurtha »

I got the script where I got the components to the plugin: https://exchange.nagios.org/directory/P ... ng/details. I looked around but I can't remember where I put define host and define service. I thought I added them to the default ms_sql_server plugin put it wasn't there when I looked. Besides that was written in php and others were written in python. I'd image I'd have to have added it to one that was just a shell script.

Thanks again,
Bryan
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: These definition can be placed in their own file or adde

Post by rkennedy »

What is the output of which java on your system?
Former Nagios Employee
bmurtha
Posts: 27
Joined: Tue Feb 23, 2016 11:08 am

Re: These definition can be placed in their own file or adde

Post by bmurtha »

/usr/bin/java

Thank you for the help,
Bryan
Locked