Page 1 of 1

JOBS MSSQL

Posted: Mon Jan 07, 2013 3:19 pm
by rbaholding
Hi,

I have a database in MSSQL with 27 jobs that I would like to monitor. Any suggestions? Is there a wizard that allows it to do?

I have no idea! Do not know how ....

thanks

Re: JOBS MSSQL

Posted: Mon Jan 07, 2013 3:28 pm
by slansing
There are three available MSSQL wizards:

Database Wizard:
http://exchange.nagios.org/directory/Ad ... rd/details

Server Wizard:
http://exchange.nagios.org/directory/Ad ... rd/details

Query Wizard:
http://exchange.nagios.org/directory/Ad ... rd/details

There is also a job monitor plugin (which is a couple years old):
http://exchange.nagios.org/directory/Pl ... ng/details

And a job history plugin:
http://exchange.nagios.org/directory/Pl ... ry/details

What else inside of MSSQL would you like to monitor?

Re: JOBS MSSQL

Posted: Mon Jan 07, 2013 3:29 pm
by abrist
There are a few different wizards for an mssql server in XI.

There are also a number on the exchange. For job monitoring, you should start here:

http://exchange.nagios.org/directory/Pl ... ng/details

Though you may want to set up server and database health monitoring through the built-in XI wizards in the Config section in NagiosXI.

EDIT: looks like Sam beat me to punch.

Re: JOBS MSSQL

Posted: Tue Jan 08, 2013 7:47 am
by rbaholding
Hi,

I indicated the steps I've been doing but I still keeps crashing ....

1 - I downloaded the file and extract mssqljob.zip.

2 - I copy the files "sqljobmon.class", "url.properties", "check_sqljob.sh" and "sqljdbc.jar" in the path: /usr/local/nagios/libexec via ssh (WinSCP). First question: When I copy the files, they have to have special permissions? By default, you leave with permission "644".

3 - I edit the file "check_sqljob.sh" and write my Java path: javacmd=/usr/bin/java. My Classpath is: CLASSPATH=/usr/local/nagios/libexec/:/usr/local/nagios/libexec/sqljdbc.jar

4 - I edit the file "url.properties" and my "HTML_DIR" and "HTML_LINK" are: HTML_DIR=/usr/local/nagios/share/HTML_LINK=/sqllog

5 - I run the following: sh check_sqljob.sh-H X.X.X.X -u user -p password and the result is as follows: <a href=/sqllog/X.X.X.X.html target=main> CRITICAL: Failed Number of Jobs: 3 | count = 3 </ a> Second question: Why are only three jobs, if my server has 27 jobs?

6 - My version is Nagios XI, creating a command definition, I do it through the website. I access: Configure - Core Configuration Manager - Commands - Commands - Add New

7 - I create the new command to sqllog:
Command Name: check_sqllog
Command Line: $USER1$/check_sqllog-H $HOSTADDRESS$ - u $ARG1$ -p $ARG2$
Active command, I save and apply changes.

8 - In the console via SSH, I see that is well set up the new command: vi /usr/local/nagios/etc/commands.cfg:
define command {
command_name check_sqllog
command_line $USER1$/check_sqllog-H $HOSTADDRESS$ - u $ARG1$ -p $ARG2$
}

9 - Now I create a new service associated with a host:
Config Name: My SQL Server
Description: test
Check command: check_sqllog
Command View: $USER1$/check_sqllog-H $HOSTADDRESS$ - u $ARG1$-p $ARG2$
Active: ok
I keep the service created and apply changes.

10 - Start the new service checks and when it ceases to be "Pending", shows the following error: CRITICAL: (Return code of 127 is out of bounds - plugin may be missing)

Third question: What am I doing wrong?

Re: JOBS MSSQL

Posted: Tue Jan 08, 2013 10:14 am
by abrist
Check the the lines I underlined below, you may be missing a space between the "check_sqllog" and "-H" switch.
rbaholding wrote:Hi,
7 - I create the new command to sqllog:
Command Name: check_sqllog
Command Line: $USER1$/check_sqllog-H $HOSTADDRESS$ - u $ARG1$ -p $ARG2$
Active command, I save and apply changes.

8 - In the console via SSH, I see that is well set up the new command: vi /usr/local/nagios/etc/commands.cfg:
define command {
command_name check_sqllog
command_line $USER1$/check_sqllog-H $HOSTADDRESS$ - u $ARG1$ -p $ARG2$
}

9 - Now I create a new service associated with a host:
Config Name: My SQL Server
Description: test
Check command: check_sqllog
Command View: $USER1$/check_sqllog-H $HOSTADDRESS$ - u $ARG1$-p $ARG2$
Active: ok
I keep the service created and apply changes.

10 - Start the new service checks and when it ceases to be "Pending", shows the following error: CRITICAL: (Return code of 127 is out of bounds - plugin may be missing)

Third question: What am I doing wrong?

Re: JOBS MSSQL

Posted: Tue Jan 08, 2013 10:55 am
by rbaholding
Was it a mistake to copy and paste the configuration in the text editor.

Really, is correct in the configuration file.

Re: JOBS MSSQL

Posted: Tue Jan 08, 2013 11:34 am
by abrist
Lets make sure permissions are right on the shell script:

Post the output of:

Code: Select all

ls -la /usr/local/nagios/libexec

Re: JOBS MSSQL

Posted: Fri Jan 18, 2013 4:09 am
by rbaholding
Sorry for the delay ...

total 9088
drwxrwxr-x. 4 nagios nagios 12288 Jan 18 09:45 .
drwxr-xr-x. 8 root root 4096 Jun 6 2012 ..
-rwxr-xr-x 1 apache apache 3874 Jan 16 12:24 check_adic.pl
-rwxr-xr-x. 1 root root 348433 Jun 6 2012 check_apt
-rw-r--r--. 1 root root 6897 Jun 6 2012 check_asterisk.pl
-rwxr-xr-x 1 nagios users 4173 Nov 26 11:42 check_bl
-rwxr-xr-x 1 nagios users 2289 Nov 26 11:42 check_bpi.php
-rwxr-xr-x. 1 root root 2274 Jun 6 2012 check_breeze
-rwxr-xr-x. 1 root root 92653 Jun 6 2012 check_by_ssh
-rwxr-xr-x 1 nagios users 14192 Jun 7 2012 check_cap
-rwxr-xr-x 1 apache apache 25875 Jan 8 17:22 check_cisco.c
-rwxr-xr-x 1 apache apache 4195 Jan 15 18:15 check_cisco_status.pl
lrwxrwxrwx. 1 root root 9 Jun 6 2012 check_clamd -> check_tcp
-rwxr-xr-x. 1 root root 50873 Jun 6 2012 check_cluster
-r-sr-xr-x. 1 root root 90337 Jun 6 2012 check_dhcp
-rwxr-xr-x. 1 root root 87773 Jun 6 2012 check_dig
-rwxr-xr-x 1 apache apache 3917 Jan 11 10:48 check_dirsize.sh
-rwxr-xr-x. 1 root root 390546 Jun 6 2012 check_disk
-rwxr-xr-x. 1 root root 8163 Jun 6 2012 check_disk_smb
-rwxr-xr-x. 1 root root 96206 Jun 6 2012 check_dns
-rwxr-xr-x. 1 root root 46260 Jun 6 2012 check_dummy
-rwxr-xr-x 1 nagios users 5625 Nov 26 11:42 check_em01.pl
-rwxr-xr-x 1 nagios users 38345 Nov 26 11:42 check_email_delivery
-rwxr-xr-x 1 nagios users 20511 Nov 26 11:42 check_email_delivery_epn
-rw-r--r--. 1 root root 20039 Jun 6 2012 check_email_loop.pl
-rwxr-xr-x 1 nagios users 28665 Jan 14 11:39 check_emc_clariion.pl
-rwxr-xr-x 1 apache apache 11062 Jan 8 17:17 check_env_stats.py
-rwxr-xr-x 1 nagios users 82841 Jan 8 17:23 check_esx3.pl
-rwxr-xr-x 1 apache apache 41135 Jan 8 17:17 check_f5.pl
-rwxr-xr-x. 1 root root 3143 Jun 6 2012 check_file_age
-rwxr-xr-x. 1 root root 6395 Jun 6 2012 check_flexlm
-rwxr-xr-x 1 apache apache 22827 Jan 15 18:16 check_fortigate_cpu
-rwxr-xr-x 1 apache apache 8037 Jan 16 16:15 check_fortigate_status
-rwxr-xr-x. 1 root root 92048 Jun 6 2012 check_fping
lrwxrwxrwx. 1 root root 9 Jun 6 2012 check_ftp -> check_tcp
-rwxr-xr-x 1 nagios users 3446 Jan 3 15:19 check_ftp_fully
-rwxr-xr-x. 1 root root 90056 Jun 6 2012 check_hpjd
-rwxr-xr-x. 1 root root 468776 Jun 6 2012 check_http
-r-sr-xr-x. 1 root root 97773 Jun 6 2012 check_icmp
-rwxr-xr-x. 1 root root 59316 Jun 6 2012 check_ide_smart
-rwxr-xr-x. 1 root root 15310 Jun 6 2012 check_ifoperstatus
-rwxr-xr-x. 1 root root 12853 Jun 6 2012 check_ifstatus
-rwxr-xr-x 1 apache apache 9972 Jan 8 17:20 check_iftraffic.php
lrwxrwxrwx. 1 root root 9 Jun 6 2012 check_imap -> check_tcp
-rwxr-xr-x 1 nagios users 35413 Nov 26 11:42 check_imap_receive
-rwxr-xr-x 1 nagios users 15576 Nov 26 11:42 check_imap_receive_epn
-rwxr-xr-x 1 nagios nagios 262358 Jan 17 16:24 check_interface_table_v3t.pl
-rwxr-xr-x. 1 root root 7429 Jun 6 2012 check_ircd
lrwxrwxrwx. 1 root root 9 Jun 6 2012 check_jabber -> check_tcp
-rwxr-xr-x. 1 root root 73626 Jun 6 2012 check_ldap
lrwxrwxrwx. 1 root root 10 Jun 6 2012 check_ldaps -> check_ldap
-rwxr-xr-x. 1 root root 73506 Jun 6 2012 check_load
-rwxr-xr-x. 1 root root 6062 Jun 6 2012 check_log
-rwxr-xr-x. 1 root root 20367 Jun 6 2012 check_mailq
-rwxr-xr-x. 1 root root 59970 Jun 6 2012 check_mrtg
-rwxr-xr-x. 1 root root 58835 Jun 6 2012 check_mrtgtraf
-rwxr-xr-x. 1 root root 12536 Nov 26 11:42 check_mssql
-rwxr-xr-x 1 nagios users 13759 Jan 3 15:17 check_mssql_database.py
-rwxr-xr-x 1 apache apache 5973 Jan 3 16:04 check_mssql_job_13082012.zip
-rwxr-xr-x 1 nagios users 20336 Jan 3 15:25 check_mssql_server.py
-rwxr-xr-x. 1 root root 94383 Jun 6 2012 check_mysql
-rwxr-xr-x. 1 root root 98711 Jun 6 2012 check_mysql_health
-rwxr-xr-x. 1 root root 86413 Jun 6 2012 check_mysql_query
-rwxr-xr-x. 1 root root 72447 Jun 6 2012 check_nagios
-rwxr-xr-x 1 nagios users 6364 Nov 26 11:42 check_nagios_performance.php
-rwxr-xr-x 1 nagios users 17209 Jun 7 2012 check_nagiosxiserver.php
-rwxr-xr-x 1 apache apache 128956 Jan 16 16:16 check_netint.pl
lrwxrwxrwx. 1 root root 9 Jun 6 2012 check_nntp -> check_tcp
lrwxrwxrwx. 1 root root 9 Jun 6 2012 check_nntps -> check_tcp
-rwxrwxr-x 1 nagios nagios 75436 Sep 6 17:35 check_nrpe
-rwxr-xr-x. 1 root root 93815 Jun 6 2012 check_nt
-rwxr-xr-x. 1 root root 96835 Jun 6 2012 check_ntp
-rwxr-xr-x. 1 root root 87051 Jun 6 2012 check_ntp_peer
-rwxr-xr-x. 1 root root 83829 Jun 6 2012 check_ntp_time
-rwxr-xr-x. 1 root root 125710 Jun 6 2012 check_nwstat
-rwxr-xr-x. 1 root root 8366 Jun 6 2012 check_oracle
-rwxr-xr-x. 1 root root 75739 Jun 6 2012 check_overcr
-rwxr-xr-x. 1 root root 69350 Jun 6 2012 check_pgsql
-rwxr-xr-x. 1 root root 99658 Jun 6 2012 check_ping
-rwxr-xr-x. 1 nagios nagios 6183 Jun 6 2012 check_pnp_rrds.pl
lrwxrwxrwx. 1 root root 9 Jun 6 2012 check_pop -> check_tcp
-rwxr-xr-x. 1 root root 281655 Nov 26 11:42 check_postgres.pl
-rwxr-xr-x. 1 root root 368712 Jun 6 2012 check_procs
-rwxr-xr-x 1 nagios users 23327 Nov 26 11:42 check_radius_adv
-rwxr-xr-x. 1 root root 71134 Jun 6 2012 check_real
-rwxr-xr-x. 1 root root 9707 Jun 6 2012 check_rpc
-rw-r--r--. 1 root root 9232 Jun 6 2012 check_rrdtraf
-rwxr-xr-x. 1 root root 5299 Jun 6 2012 check_rrdtraf.php
-rwxr-xr-x 1 root root 12590 Jan 8 17:00 check_sap
-rwxr-xr-x 1 root root 5553 Mar 16 2009 check_sap.c
-rwxr-xr-x 1 root root 11080 Jan 8 17:00 check_sap_cons
-rwxr-xr-x 1 root root 2265 Mar 16 2009 check_sap_cons.c
-rwxr-xr-x 1 root root 3728 Jan 8 17:00 check_sap_cons.o
-rwxr-xr-x 1 root root 12711 Jan 8 17:00 check_sap_cpu_load
-rwxr-xr-x 1 root root 5701 Mar 16 2009 check_sap_cpu_load.c
-rwxr-xr-x 1 root root 5440 Jan 8 17:00 check_sap_cpu_load.o
-rwxr-xr-x 1 root root 12567 Jan 8 17:00 check_sap_instance
-rwxr-xr-x 1 root root 4664 Mar 16 2009 check_sap_instance.c
-rwxr-xr-x 1 root root 11216 Jan 8 17:00 check_sap_instance_cons
-rwxr-xr-x 1 root root 2440 Mar 16 2009 check_sap_instance_cons.c
-rwxr-xr-x 1 root root 3824 Jan 8 17:00 check_sap_instance_cons.o
-rwxr-xr-x 1 root root 5184 Jan 8 17:00 check_sap_instance.o
-rwxr-xr-x 1 root root 12623 Jan 8 17:00 check_sap_multiple
-rwxr-xr-x 1 root root 4641 Mar 16 2009 check_sap_multiple.c
-rwxr-xr-x 1 root root 5256 Jan 8 17:00 check_sap_multiple.o
-rwxr-xr-x 1 root root 11111 Jan 8 17:00 check_sap_mult_no_thr
-rwxr-xr-x 1 root root 2656 Mar 16 2009 check_sap_mult_no_thr.c
-rwxr-xr-x 1 root root 3816 Jan 8 17:00 check_sap_mult_no_thr.o
-rwxr-xr-x 1 root root 5176 Jan 8 17:00 check_sap.o
-rwxr-xr-x 1 root root 10821 Jan 8 17:00 check_sap_system
-rwxr-xr-x 1 root root 2278 Mar 16 2009 check_sap_system.c
-rwxr-xr-x 1 root root 10826 Jan 8 17:00 check_sap_system_cons
-rwxr-xr-x 1 root root 2142 Mar 16 2009 check_sap_system_cons.c
-rwxr-xr-x 1 root root 3408 Jan 8 17:00 check_sap_system_cons.o
-rwxr-xr-x 1 root root 3408 Jan 8 17:00 check_sap_system.o
-rwxr-xr-x. 1 root root 1176 Jun 6 2012 check_sensors
lrwxrwxrwx. 1 root root 9 Jun 6 2012 check_simap -> check_tcp
-rw-r--r--. 1 root root 7599 Jun 6 2012 check_sip
-rwxr-xr-x. 1 root root 406354 Jun 6 2012 check_smtp
-rwxr-xr-x 1 nagios users 20226 Nov 26 11:42 check_smtp_send
-rwxr-xr-x 1 nagios users 10440 Nov 26 11:42 check_smtp_send_epn
-rwxr-xr-x. 1 root root 408607 Jun 6 2012 check_snmp
-rw-r--r--. 1 root root 10951 Jun 6 2012 check_snmp_boostedge.pl
-rwxr-xr-x 1 apache apache 12714 Jan 8 17:17 check_snmp_cisco_ports_bandwidth
-rwxr-xr-x 1 apache apache 4793 Jan 9 18:19 check_snmp_cisco_stack.pl
-rwxr-xr-x 1 apache apache 7144 Jan 8 18:01 check_snmp_cisco_traffic
-rw-r--r-- 1 root root 8 Jan 9 16:40 check_snmp_cisco_traffic.txt
-rw-r--r--. 1 root root 17866 Jun 6 2012 check_snmp_cpfw.pl
-rw-r--r--. 1 root root 8747 Jun 6 2012 check_snmp_css_main.pl
-rw-r--r--. 1 root root 16786 Jun 6 2012 check_snmp_css.pl
-rw-r--r--. 1 root root 33562 Jun 6 2012 check_snmp_env.pl
-rwxr-xr-x 1 nagios users 23464 Nov 26 11:42 check_snmp_generic.pl
-rw-r--r--. 1 root root 31919 Jun 6 2012 check_snmp_int.pl
-rw-r--r--. 1 root root 10108 Jun 6 2012 check_snmp_linkproof_nhr.pl
-rwxr-xr-x 1 apache apache 25148 Jan 15 18:16 check_snmp_load.pl
-rwxr-xr-x 1 nagios users 22845 Jan 3 15:20 check_snmp_load_wizard.pl
-rwxr-xr-x 1 apache apache 5808 Jan 8 17:17 check_snmp_math.pl
-rw-r--r--. 1 root root 18734 Jun 6 2012 check_snmp_mem.pl
-rwxr-xr-x 1 apache apache 83198 Jan 16 16:36 check_snmp_netint_21.pl
-rwxr-xr-x 1 apache apache 92604 Jan 15 18:16 check_snmp_netint.pl
-rw-r--r--. 1 root root 11898 Jun 6 2012 check_snmp_nsbox.pl
-rwxr-xr-x. 1 root root 26182 Nov 26 11:42 check_snmp_process.pl
-rwxr-xr-x 1 nagios users 26183 Jan 3 15:20 check_snmp_process_wizard.pl
-rwxr-xr-x. 1 root root 25483 Nov 26 11:42 check_snmp_storage.pl
-rwxr-xr-x 1 nagios users 25484 Jan 3 15:20 check_snmp_storage_wizard.pl
-rw-r--r--. 1 root root 14489 Jun 6 2012 check_snmp_vrrp.pl
-rwxr-xr-x. 1 root root 12058 Nov 26 11:42 check_snmp_win.pl
lrwxrwxrwx. 1 root root 9 Jun 6 2012 check_spop -> check_tcp
-rw-r--r-- 1 root root 1622 Jan 8 12:15 check_sqljob.sh
-rwxr-xr-x. 1 root root 69094 Jun 6 2012 check_ssh
-rwxr-xr-x 1 nagios users 8337 Nov 26 11:42 check_ssh_expect.pl
lrwxrwxrwx. 1 root root 9 Jun 6 2012 check_ssmtp -> check_tcp
-rwxr-xr-x. 1 root root 74796 Jun 6 2012 check_swap
-rwxr-xr-x. 1 root root 123180 Jun 6 2012 check_tcp
-rwxr-xr-x. 1 root root 71240 Jun 6 2012 check_time
-rwxr-xr-x 1 apache apache 817 Jan 8 17:20 check-traffic.php
lrwxrwxrwx. 1 root root 9 Jun 6 2012 check_udp -> check_tcp
-rwxr-xr-x. 1 root root 84166 Jun 6 2012 check_ups
-rwxr-xr-x. 1 root root 68835 Jun 6 2012 check_users
-rwxr-xr-x. 1 root root 3019 Jun 6 2012 check_wave
-rwxr-xr-x. 1 root root 307 Jun 6 2012 check_webinject.sh
-rwxr-xr-x 1 nagios users 7065 Jan 3 15:27 check_win_snmp_disk.pl
-rwxr-xr-x 1 nagios users 2405 Jan 3 15:26 check_wmi_plus.conf
-rwxr-xr-x 1 nagios users 46543 Jan 3 15:26 check_wmi_plus.ini
-rwxr-xr-x 1 nagios users 237155 Jan 3 15:26 check_wmi_plus.pl
-rwxr-xr-x. 1 root root 75011 Jun 6 2012 negate
drwxr-xr-x 8 nagios nagios 4096 Sep 6 17:33 nrpe-2.13
-rwxr-xr-x 1 apache apache 411768 Sep 6 17:26 nrpe-2.13.tar.gz
drwxrwxr-x 6 nagios nagios 4096 Sep 6 19:52 nsca-2.7.2
-rwxr-xr-x 1 apache apache 104953 Sep 6 17:25 nsca-2.7.2.tar.gz
-rwxr-xr-x. 1 nagios nagios 42724 Jun 6 2012 process_perfdata.pl
-rwxr-xr-x. 1 root root 64618 Jun 6 2012 send_nsca
-rwxr-xr-x 1 root root 217 Sep 26 15:06 servicerestart.sh
-rw-r--r-- 1 root root 583286 Jul 25 2010 sqljdbc.jar
-rw-r--r-- 1 root root 7540 Jul 25 2010 SqlJobMon.class
-rwxr-xr-x. 1 root root 68266 Jun 6 2012 urlize
-rw-r--r-- 1 root root 54 Jan 8 12:17 url.properties
-rwxr-xr-x. 1 root root 2035 Jun 6 2012 utils.pm
-rwxr-xr-x. 1 root root 862 Jun 6 2012 utils.sh

Re: JOBS MSSQL

Posted: Fri Jan 18, 2013 10:34 am
by slansing
It looks as though you never added the following script to the libexec directory I would do so and then report back after running a check:

Code: Select all

check_sqllog