<!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.2900.2523" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left> </DIV>
<DIV> </DIV>
<DIV align=left><FONT face=v size=2><STRONG>Paulo Afonso Graner 
Fessel</STRONG></FONT></DIV>
<DIV align=left><EM><FONT size=1>Administrador de Ambiente e Sistemas 
UNIX</FONT></EM></DIV>
<DIV align=left><FONT size=1>
<DIV align=left><FONT size=1><A 
href="mailto:paulo.fessel@primesys.com.br">paulo.fessel@primesys.com.br</A></FONT></DIV>OWT</FONT></DIV>
<DIV align=left><FONT size=1>Fone: +55 (11) 3038-6554</FONT></DIV>
<DIV align=left><FONT size=1>Fax: +55 (11) 3038-6508</FONT></DIV>
<DIV align=left><FONT size=1><A 
href="http://www.primesys.com.br/">http://www.primesys.com.br</A></FONT></DIV>
<DIV align=left> </DIV>
<DIV align=left><IMG id=_x0000_i1025 height=67 src="cid:718445013@21012005-05D0" 
width=110 border=0></DIV>
<DIV align=left> </DIV>
<DIV> </DIV><BR>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=pt-br dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>De:</B> Paulo Afonso Graner Fessel <BR><B>Enviada 
  em:</B> quinta-feira, 20 de janeiro de 2005 15:50<BR><B>Para:</B> 
  'nagiosplug-devel@lists.sourceforge.net'<BR><B>Assunto:</B> Patches: 
  check_swap and check_procs<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV><FONT face=Arial size=2><SPAN class=718465116-20012005>Hello, 
  folks:</SPAN></FONT></DIV>
  <DIV><FONT face=Arial size=2><SPAN 
  class=718465116-20012005></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial size=2><SPAN class=718465116-20012005>I have two patches 
  here: the first for check_swap fixes the problems found with AIX when using 
  unsigned long long with gcc. Tested in AIX 4.3 and 5.1 and linux 2.4 and 
  2.6.</SPAN></FONT></DIV>
  <DIV><FONT face=Arial size=2><SPAN 
  class=718465116-20012005></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial size=2><SPAN class=718465116-20012005>The second is a 
  patch that implements performance counters for check_procs. When run 
  without metrics specified, it can check against warning and critical 
  thresholds of the absolute number of processes. When the option 
  "--metric=VARIABLE" is specified, it will tell 3 counters: the number of 
  process for which the counter is in "OK", "WARNING" and "CRITICAL" states. 
  Again, tested on linux and AIX.</SPAN></FONT></DIV>
  <DIV><FONT face=Arial size=2><SPAN 
  class=718465116-20012005></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial size=2><SPAN class=718465116-20012005>Finally, someone 
  who knows automake and autoconf (I don't) should correct the ps command 
  for procps-3.1(.19). By default it runs ps as "ps -axwo" which causes 
  check_procs to return with a warning:</SPAN></FONT></DIV>
  <DIV><FONT face=Arial size=2><SPAN 
  class=718465116-20012005></SPAN></FONT> </DIV>
  <DIV><FONT size=2><SPAN class=718465116-20012005><FONT 
  face="Courier New">[root@nagios plugins]# ./check_procs -vv<BR>CMD: /bin/ps 
  -axwo 'stat uid ppid vsz rss pcpu comm args'<BR>STDERR: Warning: bad syntax, 
  perhaps a bogus '-'? See </FONT><A href="http://procps.sf.net/faq.html"><FONT 
  face="Courier New">http://procps.sf.net/faq.html</FONT></A><BR><FONT 
  face="Courier New">System call sent warnings to stderr<BR>PROCS WARNING: 285 
  processes | Processes=285;;;</FONT></SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN class=718465116-20012005><FONT 
  face="Courier New"></FONT></SPAN></FONT> </DIV>
  <DIV><FONT size=2><SPAN class=718465116-20012005><FONT 
  face="Courier New"><FONT face=Arial>After changing the ps command in 
  config.h:</FONT></FONT></SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN class=718465116-20012005><FONT 
  face="Courier New"><FONT face=Arial></FONT></FONT></SPAN></FONT> </DIV>
  <DIV><FONT face="Courier New" size=2><SPAN 
  class=718465116-20012005>[root@nagios plugins]# ./check_procs -vv<BR>CMD: 
  /bin/ps axwo 'stat uid ppid vsz rss pcpu comm args'<BR>PROCS OK: 271 processes 
  | Processes=271;;;</SPAN></FONT></DIV>
  <DIV><FONT face="Courier New" size=2><SPAN 
  class=718465116-20012005></SPAN></FONT> </DIV>
  <DIV><FONT face="Courier New" size=2><SPAN class=718465116-20012005><FONT 
  face=Arial>Please evaluate the patches in other platforms and apply if 
  shouldn't bring problems.</FONT></SPAN></FONT></DIV>
  <DIV><FONT face="Courier New" size=2><SPAN class=718465116-20012005><FONT 
  face=Arial></FONT></SPAN></FONT> </DIV>
  <DIV><FONT face="Courier New" size=2><SPAN class=718465116-20012005><FONT 
  face=Arial>[]'s</FONT></SPAN></FONT></DIV>
  <DIV><FONT face="Courier New" size=2><SPAN 
  class=718465116-20012005></SPAN></FONT><FONT face="Courier New" size=2><SPAN 
  class=718465116-20012005><FONT face=Arial>Paulo</FONT></DIV>
  <DIV></SPAN></FONT><FONT face=v size=2><STRONG></STRONG></FONT> </DIV>
  <DIV><FONT face=v size=2><STRONG>Paulo Afonso Graner 
  Fessel</STRONG></FONT></DIV>
  <DIV align=left><EM><FONT size=1>Administrador de Ambiente e Sistemas 
  UNIX</FONT></EM></DIV>
  <DIV align=left><FONT size=1>
  <DIV align=left><FONT size=1><A 
  href="mailto:paulo.fessel@primesys.com.br">paulo.fessel@primesys.com.br</A></FONT></DIV>OWT</FONT></DIV>
  <DIV align=left><FONT size=1>Fone: +55 (11) 3038-6554</FONT></DIV>
  <DIV align=left><FONT size=1>Fax: +55 (11) 3038-6508</FONT></DIV>
  <DIV align=left><FONT size=1><A 
  href="http://www.primesys.com.br/">http://www.primesys.com.br</A></FONT></DIV>
  <DIV align=left> </DIV>
  <DIV align=left><IMG id=_x0000_i1025 height=67 
  src="cid:718465116@20012005-1943" width=110 border=0></DIV>
  <DIV align=left> </DIV>
  <DIV> </DIV></BLOCKQUOTE></BODY></HTML>