<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1498" name=GENERATOR>
<STYLE>@font-face {
        font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
font-face {
        FONT-FAMILY: Tahoma
}
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
PRE {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Courier New"
}
SPAN.emailstyle17 {
        COLOR: windowtext; FONT-FAMILY: Arial
}
SPAN.EmailStyle19 {
        COLOR: navy; FONT-FAMILY: Arial
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=999495317-12102005><FONT face=Arial 
color=#0000ff size=2>Hi all,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=999495317-12102005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=999495317-12102005><FONT face=Arial 
color=#0000ff size=2>In the contrib folder there's a check_mssql 
plug-in.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=999495317-12102005><FONT face=Arial 
color=#0000ff size=2>u can tweak it to do whatever you want it to 
do.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=999495317-12102005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=999495317-12102005><FONT face=Arial 
color=#0000ff size=2>I'm working on changing it so it can check free space left 
in the MsSQL database</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=999495317-12102005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=999495317-12102005><FONT face=Arial 
color=#0000ff size=2>A.</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> nagios-users-admin@lists.sourceforge.net 
[mailto:nagios-users-admin@lists.sourceforge.net] <B>On Behalf Of </B>Petrucci, 
Joseph<BR><B>Sent:</B> Wednesday, October 12, 2005 10:36 AM<BR><B>To:</B> 
Forough, Hamid; nagios-users@lists.sourceforge.net<BR><B>Subject:</B> RE: 
[Nagios-users] PLease help<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=799003114-12102005><FONT face=Arial color=#0000ff size=2>There 
is a SQL function called raiseerror it will write an error that you definewithin 
the SQL server to the errorlog. This is in Sybase but I thionk it is still in 
MSSQL. you can find information on it in the admin manual. I use this functio 
inside my stored procedures to put the results of the procedure in the errorlog. 
I then use a passive check in Nagios to read the errorlog (I wrote this in 
ActivePerl) and look for certain error codes. The passive plugin passes the 
results to Nagios every 5 minutes and Nagios sends a critical alert if any of 
the errors are present in the errorlog for the given period.</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Forough, Hamid 
  [mailto:hamid.forough@amd.com]<BR><B>Sent:</B> Wednesday, October 12, 2005 
  10:18 AM<BR><B>To:</B> Petrucci, Joseph; 
  nagios-users@lists.sourceforge.net<BR><B>Subject:</B> RE: [Nagios-users] 
  PLease help<BR><BR></FONT></DIV>
  <DIV class=Section1>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I don’t understand. 
  Can you elaborate please?</SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
  <DIV>
  <DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT 
  face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
  <HR tabIndex=-1 align=center width="100%" SIZE=2>
  </SPAN></FONT></DIV>
  <P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN 
  style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT 
  face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> 
  Petrucci, Joseph [mailto:Joseph.Petrucci@ddiworld.com] <BR><B><SPAN 
  style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tuesday, October 11, 2005 11:58 
  AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Forough, Hamid; 
  nagios-users@lists.sourceforge.net<BR><B><SPAN 
  style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [Nagios-users] PLease 
  help</SPAN></FONT></P></DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
  <DIV id=idOWAReplyText43136>
  <DIV>
  <P class=MsoNormal><FONT face=Arial color=black size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial">I do this with 
  Sybase and it should still work this way i MSSQL 2K.</SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face=Arial color=black size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial">I would use a 
  passive check (info on this is in the manual)  that reads the errorlog. 
  Then you will have to have your procedure execute a raiserror in the event of 
  failure or any other message you want. Have the plugin look at the error log 
  for specific error numbers that you define in the master.dbo.syserrors table 
  (If there still is one) </SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV></DIV>
  <DIV id=idSignature21269><PRE><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">Joseph A. Petrucci</SPAN></FONT></PRE><PRE><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">E Systems DBA</SPAN></FONT></PRE><PRE><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">------------------------------------------------</SPAN></FONT></PRE><PRE><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">Desk: 412-220-2646</SPAN></FONT></PRE><PRE><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">Cell: 412-916-2867</SPAN></FONT></PRE><PRE><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">Text message (e-mail) 4129162867@mobile.att.net</SPAN></FONT></PRE><PRE><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">e-mail joseph.petrucci@ddiworld.com</SPAN></FONT></PRE><PRE><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">Personal Cell: 724-462-0443</SPAN></FONT></PRE><PRE><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">Personal e-mail: japetrucci@hotmail.com</SPAN></FONT></PRE></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
  <DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT 
  face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
  <HR tabIndex=-1 align=center width="100%" SIZE=2>
  </SPAN></FONT></DIV>
  <P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><FONT face=Tahoma 
  size=2><SPAN 
  style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT 
  face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> 
  nagios-users-admin@lists.sourceforge.net on behalf of Forough, 
  Hamid<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tue 10/11/2005 
  11:45 AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> 
  nagios-users@lists.sourceforge.net<BR><B><SPAN 
  style="FONT-WEIGHT: bold">Subject:</SPAN></B> [Nagios-users] PLease 
  help</SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I need to know how to write a 
  custom plugin that checks results of a stored procedure in MSSQL 2k and 
  returns Yes or NO? I am using 2b4 verision of Nagios</SPAN></FONT></P>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
  <P class=MsoNormal><FONT face=Tahoma size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">Thanks,<BR>Hamid</SPAN></FONT></P>
  <P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN 
  style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">Advanced Micro 
  Devices</SPAN></FONT></B></P>
  <P class=MsoNormal><FONT face=Tahoma size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><IMG height=29 
  src="cid:999495317@12102005-0F59" width=108 border=0></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Tahoma size=2><SPAN lang=DE 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">W: 512.602.4704<BR>C: 
  512.971-5345<BR>E: <A 
  href="mailto:hamid.forough@amd.com">hamid.forough@amd.com</A></SPAN></FONT><SPAN 
  lang=DE><BR> </SPAN></P>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV></DIV></BLOCKQUOTE></BODY></HTML>