<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://petersap.nl/SybaseWiki/index.php?action=history&amp;feed=atom&amp;title=Nagios_plugin_for_ASE</id>
		<title>Nagios plugin for ASE - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://petersap.nl/SybaseWiki/index.php?action=history&amp;feed=atom&amp;title=Nagios_plugin_for_ASE"/>
		<link rel="alternate" type="text/html" href="http://petersap.nl/SybaseWiki/index.php?title=Nagios_plugin_for_ASE&amp;action=history"/>
		<updated>2026-04-04T20:42:29Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.2</generator>

	<entry>
		<id>http://petersap.nl/SybaseWiki/index.php?title=Nagios_plugin_for_ASE&amp;diff=1731&amp;oldid=prev</id>
		<title>Psap at 22:02, 18 December 2007</title>
		<link rel="alternate" type="text/html" href="http://petersap.nl/SybaseWiki/index.php?title=Nagios_plugin_for_ASE&amp;diff=1731&amp;oldid=prev"/>
				<updated>2007-12-18T22:02:03Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 22:02, 18 December 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 58:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 58:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Setup Sybase environment==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Setup Sybase environment==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Check that &lt;/del&gt;the servers you want to monitor &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;are defined in &lt;/del&gt;the $SYBASE/interfaces file. Sample:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Before you go further, check if you have Sybase OpenClient software installed on the server where Nagios is running.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Add &lt;/ins&gt;the servers you want to monitor &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;to &lt;/ins&gt;the $SYBASE/interfaces file. Sample:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ASE1&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ASE1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; query tcp ether prd-syb-ase1 4000&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; query tcp ether prd-syb-ase1 4000&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 66:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Log on to the ASE server and add a login that will be used by Nagios to connect to &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the &lt;/del&gt;ASE.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Log on to the ASE server and add a login that will be used by Nagios to connect to ASE.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; isql -Usa -SASE1&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; isql -Usa -SASE1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; 1&amp;gt; sp_addlogin nagios,nagios&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; 1&amp;gt; sp_addlogin nagios,nagios&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key website-mw_:diff:version:1.11a:oldid:1730:newid:1731 --&gt;
&lt;/table&gt;</summary>
		<author><name>Psap</name></author>	</entry>

	<entry>
		<id>http://petersap.nl/SybaseWiki/index.php?title=Nagios_plugin_for_ASE&amp;diff=1730&amp;oldid=prev</id>
		<title>Psap at 19:08, 17 December 2007</title>
		<link rel="alternate" type="text/html" href="http://petersap.nl/SybaseWiki/index.php?title=Nagios_plugin_for_ASE&amp;diff=1730&amp;oldid=prev"/>
				<updated>2007-12-17T19:08:13Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;When you are using Nagios (http://www.nagios.org) as a monitoring tool, it's real easy to implement your own checks for Sybase servers. Here's a sample check to see if your ASE server is up and connectable.&lt;br /&gt;
&lt;br /&gt;
===Create Nagios check script===&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # Plugin for Nagios to check if an ASE is up&lt;br /&gt;
 # Author Peter Sap (www.petersap.nl)&lt;br /&gt;
 # All disclamers apply.&lt;br /&gt;
 &lt;br /&gt;
 if [ $# -ne 1 ]&lt;br /&gt;
 then&lt;br /&gt;
   echo &amp;quot;Usage $0: &amp;lt;ASE server&amp;gt;&amp;quot;&lt;br /&gt;
   exit 1&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 SERVER=$1&lt;br /&gt;
 &lt;br /&gt;
 STATE_OK=0&lt;br /&gt;
 STATE_WARNING=1&lt;br /&gt;
 STATE_CRITICAL=2&lt;br /&gt;
 STATE_UNKNOWN=3&lt;br /&gt;
 STATE_DEPENDENT=4&lt;br /&gt;
 &lt;br /&gt;
 export  SYBASE=&amp;lt;location of OpenClient software&amp;gt;&lt;br /&gt;
 export  SYBASE_OCS=OCS-15_0&lt;br /&gt;
 &lt;br /&gt;
 $SYBASE/$SYBASE_OCS/bin/isql -Unagios -Pnagios -S${SERVER} -b&amp;lt;&amp;lt;EOF &amp;gt; /tmp/$$&lt;br /&gt;
 set     nocount on&lt;br /&gt;
 go&lt;br /&gt;
 select  count(*)&lt;br /&gt;
         from    master..sysprocesses&lt;br /&gt;
         where   suid    != 0&lt;br /&gt;
 go&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 if [ `head -n 1 /tmp/$$|grep &amp;quot;CT-LIBRARY&amp;quot;|wc -l` -gt 0 ]&lt;br /&gt;
 then&lt;br /&gt;
   rm -f /tmp/$$&lt;br /&gt;
   echo &amp;quot;Could not connect to ${SERVER}.&amp;quot;&lt;br /&gt;
   exit ${STATE_CRITICAL}&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 if [ `head -n 1 /tmp/$$|grep &amp;quot;^Msg &amp;quot;|wc -l` -gt 0 ]&lt;br /&gt;
 then&lt;br /&gt;
   MSG=`head -n 3 /tmp/$$|tail -n 1`&lt;br /&gt;
   rm -f /tmp/$$&lt;br /&gt;
   echo &amp;quot;Could not connect to ${SERVER}, ${MSG}&amp;quot;&lt;br /&gt;
   exit ${STATE_CRITICAL}&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 COUNT=`cat /tmp/$$`&lt;br /&gt;
 &lt;br /&gt;
 rm -f /tmp/$$&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Server ${SERVER} up,&amp;quot; ${COUNT} &amp;quot;active sessions (including workers)&amp;quot;&lt;br /&gt;
 exit ${STATE_OK}&lt;br /&gt;
&lt;br /&gt;
Store this script in the Nagios libexec directory with the name &amp;quot;check_sybase_ase_up&amp;quot; . Do a &amp;quot;chmod +x&amp;quot; to make it executable.&lt;br /&gt;
&lt;br /&gt;
==Setup Sybase environment==&lt;br /&gt;
Check that the servers you want to monitor are defined in the $SYBASE/interfaces file. Sample:&lt;br /&gt;
 ASE1&lt;br /&gt;
    query tcp ether prd-syb-ase1 4000&lt;br /&gt;
The interfaces file must be stored on the machine where Nagios is running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Log on to the ASE server and add a login that will be used by Nagios to connect to the ASE.&lt;br /&gt;
 isql -Usa -SASE1&lt;br /&gt;
 1&amp;gt; sp_addlogin nagios,nagios&lt;br /&gt;
 2&amp;gt; go&lt;br /&gt;
 Password correctly set.&lt;br /&gt;
 Account unlocked.&lt;br /&gt;
 New login created.&lt;br /&gt;
 (return status = 0)&lt;br /&gt;
 1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Edit Nagios files==&lt;br /&gt;
Define the &amp;quot;check_sybase_ase_up&amp;quot; script in the definition file for commands, e.g. checkcommands.cfg&lt;br /&gt;
 # 'check_sybase_ase_up' command definition&lt;br /&gt;
 define  command{&lt;br /&gt;
         command_name    check_sybase_ase_up&lt;br /&gt;
         command_line    $USER1$/check_sybase_ase_up $ARG1$&lt;br /&gt;
         }&lt;br /&gt;
Now you can use the command as a service check. Add this sample to the definition file for your checks, to check the ASE1 server.&lt;br /&gt;
&lt;br /&gt;
 define service{&lt;br /&gt;
        use                     generic-service&lt;br /&gt;
        host_name               prd-syb-ase1&lt;br /&gt;
        service_description     ASE1&lt;br /&gt;
        is_volatile             0&lt;br /&gt;
        check_period            24x7&lt;br /&gt;
        max_check_attempts      4&lt;br /&gt;
        normal_check_interval   5&lt;br /&gt;
        retry_check_interval    1&lt;br /&gt;
        contact_groups          admins&lt;br /&gt;
        notification_options    w,u,c,r&lt;br /&gt;
        notification_interval   960&lt;br /&gt;
        notification_period     24x7&lt;br /&gt;
        check_command           check_sybase_ase_up!ASE1&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Restart Nagios.&lt;br /&gt;
&lt;br /&gt;
[[category:ASE]]&lt;/div&gt;</summary>
		<author><name>Psap</name></author>	</entry>

	</feed>