<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19154"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=499432613-23112011><FONT color=#0000ff 
size=2 face=Arial>Hi there --</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=499432613-23112011><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=499432613-23112011><FONT color=#0000ff 
size=2 face=Arial>The command definition for database_connection-time is the 
following:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=499432613-23112011><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial>define command 
{<BR>                
command_name                       <SPAN 
class=499432613-23112011> </SPAN><SPAN 
class=499432613-23112011>database</SPAN>_connection-time<BR>                
command_line                          
/usr/local/nagios/libexec/check_mssql_health --server=<SPAN 
class=499432613-23112011><database></SPAN> --username=<SPAN 
class=499432613-23112011><username></SPAN> --password=<SPAN 
class=499432613-23112011><password></SPAN> --port=<SPAN 
class=499432613-23112011><port></SPAN> --mode=connection-time</FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV><SPAN class=499432613-23112011><FONT color=#0000ff size=2 face=Arial>There 
are arguments that are passed to the command. I did not remove the exclamation 
point due to another command that also has </FONT></SPAN></DIV>
<DIV><SPAN class=499432613-23112011><FONT color=#0000ff size=2 
face=Arial>arguments passed to it. For example:</FONT></SPAN></DIV>
<DIV><SPAN class=499432613-23112011><FONT color=#0000ff size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial>define command 
{<BR>                
command_name                       check_nis_server<SPAN 
class=499432613-23112011></SPAN><BR>                
command_line                          
/usr/local/nagios/libexec/check_nis -H <SPAN 
class=499432613-23112011><server></SPAN> 
-d <domainname></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=499432613-23112011>has 
the following definition in the services.cfg file:</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=499432613-23112011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=499432613-23112011>define 
service 
{<BR>                
service_description                   
Check NIS 
Service<BR>                
check_command                      check_nis_server!<BR>                
host_name                             <server><BR>                
check_period                          
24x7<BR>                
notification_period                   
24x7<BR>                
contact_groups                        
linux-admins<BR>                
event_handler_enabled                 
0<BR>                
active_checks_enabled                 
1<BR>                
passive_checks_enabled                
0<BR>                
notifications_enabled                 
1<BR>                
check_freshness                       
0<BR>                
freshness_threshold                   
86400<BR>                
use                                   
generic-service</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=499432613-23112011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=499432613-23112011>One 
thing I came across so far. I had imported the configuration files into the 
NConf utility database of the Nagios server. Among the files that were imported 
was the</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=499432613-23112011>commands.cfg file. During the importation process, the 
commands.cfg file data was imported into a field called checkcommands. When the 
NConf utility was subsequently</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=499432613-23112011>used 
to generate new files, a checkcommands.cfg file was among the them. 
</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=499432613-23112011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=499432613-23112011>This 
file, along with the original commands.cfg file, is located in the 
/usr/local/nagios/etc/objects directory. However, the nagios.cfg file does not 
reference it. One idea that </SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=499432613-23112011>I had 
was to remove the reference within nagios.cfg to commands.cfg, and replace it 
with a reference to checkcommands.cfg, and see what are the 
results.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=499432613-23112011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=499432613-23112011>What 
do you think?</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=499432613-23112011> </DIV>
<DIV><BR></DIV></SPAN></FONT>
<DIV><FONT face=Arial><BR><FONT color=#0000ff size=2></FONT></FONT></DIV>
<DIV><SPAN class=499432613-23112011><FONT color=#0000ff size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=499432613-23112011><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Claudio Kuenzler 
[mailto:ck@claudiokuenzler.com] <BR><B>Sent:</B> Wednesday, November 23, 2011 
2:26 AM<BR><B>To:</B> Nagios Users List<BR><B>Subject:</B> Re: [Nagios-users] 
problem with newly created checkcommand andservice<BR></FONT><BR></DIV>
<DIV></DIV><FONT size=2><FONT face=Arial>Hi,<BR><BR>Please show the command 
definition of database_connection-time.<BR><BR>Furthermore in the service 
definition you use the following line:<BR><BR></FONT></FONT><FONT size=2 
face=Arial><SPAN style="FONT-FAMILY: courier new,monospace">check_command   
        
        
database_connection-time!</SPAN><BR><BR>Didn't you want to pass arguments to the 
command? If they're already hardcoded in the command definition you can leave 
the exclamation mark off.<BR></FONT><FONT size=2 face=Arial></FONT><BR>
<DIV class=gmail_quote>On Tue, Nov 22, 2011 at 7:29 PM, Kaplan, Andrew H. <SPAN 
dir=ltr><<A 
href="mailto:AHKAPLAN@partners.org">AHKAPLAN@partners.org</A>></SPAN> 
wrote:<BR>
<BLOCKQUOTE 
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
class=gmail_quote><U></U>
  <DIV>
  <P><FONT size=2 face=Arial>Hi there --<BR><BR>I am going through the motions 
  of adding a new checkcommand, and service to the Nagios server. The command 
  involves </FONT><BR><FONT size=2 face=Arial>the check_mssql_health plugin 
  which runs on the Nagios server. The plugin gets in information via queries to 
  a particular </FONT></P>
  <P><FONT size=2 face=Arial>port on the Microsoft SQL server. Here are its 
  particulars: </FONT></P>
  <P><B><FONT size=2 face=Arial>/usr/local/nagios/libexec/check_mssql_health 
  --server=<database server> --username=<username> 
  --password=<password> --port=<port> 
  --mode=connection-time</FONT></B> </P>
  <P><FONT size=2 face=Arial>The name of the checkcommand is:</FONT><B> <FONT 
  size=2 face=Arial>database_connection-time<BR></FONT></B><BR><FONT size=2 
  face=Arial>Once the checkcommand was created, so was the service. The 
  configuration of the service in question, taken from the </FONT><BR><FONT 
  size=2 face=Arial>services.cfg file, is shown below:<BR><BR>define service 
  {<BR>service_description     
          
          Database Connection 
  Time<BR>check_command           
          
  database_connection-time!<BR>host_name       
          
          
          <database 
  server><BR>check_period    
          
          
          24x7<BR>contact_groups  
          
          
          
  nt-admins,linux-admins,admins<BR>event_handler_enabled   
          
          0<BR>active_checks_enabled   
          
          1<BR>passive_checks_enabled  
          0<BR>notifications_enabled   
          
          1<BR>check_freshness 
          
          
          0<BR>freshness_threshold 
              
          86400<BR>use     
          
          
          
          generic-service<BR>}<BR><BR>To 
  verify the new configuration would work, the command:</FONT> </P>
  <P><B><FONT size=2 face=Arial>/usr/local/nagios/bin/nagios -v 
  /usr/local/nagios/etc/nagios.cfg</FONT></B><BR><BR><FONT size=2 face=Arial>was 
  run to verify the configuration. It was here the error message: </FONT></P>
  <UL>
    <P><B><FONT size=2 face=Arial>Checking services...<BR>Error: Service check 
    command '<database>_connection-time' specified in service 'Database 
    Connection Time' for host '<database server>' not defined 
    anywhere!</FONT></B></P></UL>
  <P><FONT size=2 face=Arial>I verified the syntax of the command in the 
  checkcommands.cfg file, including the name given to the command. Why would 
  Nagios </FONT></P>
  <P><FONT size=2 face=Arial>think the service check command is not defined, and 
  return this error? </FONT></P><BR><BR><FONT face=monospace><BR><BR>The 
  information in this e-mail is intended only for the person to whom it 
  is<BR>addressed. If you believe this e-mail was sent to you in error and the 
  e-mail<BR>contains patient information, please contact the Partners Compliance 
  HelpLine at<BR><A href="http://www.partners.org/complianceline" 
  target=_blank>http://www.partners.org/complianceline</A> . If the e-mail was 
  sent to you in error<BR>but does not contain patient information, please 
  contact the sender and properly<BR>dispose of the 
  e-mail.</FONT></DIV><BR>------------------------------------------------------------------------------<BR>All 
  the data continuously generated in your IT infrastructure<BR>contains a 
  definitive record of customers, application performance,<BR>security threats, 
  fraudulent activity, and more. Splunk takes this<BR>data and makes sense of 
  it. IT sense. And common sense.<BR><A href="http://p.sf.net/sfu/splunk-novd2d" 
  target=_blank>http://p.sf.net/sfu/splunk-novd2d</A><BR>_______________________________________________<BR>Nagios-users 
  mailing list<BR><A 
  href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</A><BR><A 
  href="https://lists.sourceforge.net/lists/listinfo/nagios-users" 
  target=_blank>https://lists.sourceforge.net/lists/listinfo/nagios-users</A><BR>::: 
  Please include Nagios version, plugin version (-v) and OS when reporting any 
  issue.<BR>::: Messages without supporting info will risk being sent to 
  /dev/null<BR></BLOCKQUOTE></DIV><BR></BODY></HTML>