Ticket #73 (closed task: fixed)

Opened 5 years ago

Last modified 3 years ago

Bug i ps_ plugin on systems using pgrep

Reported by: runesk@linpro.no Assigned to: jo
Priority: high Milestone: Munin 1.2 running maintenance
Component: rpm package Version: 1.2.1
Severity: minor Keywords: vemaujvy
Cc: vemaujvy

Description

On nodes using pgrep, the wc -l counts the grep proccess as well, resulting in a count that is +1 to high.

By adding grep -v grep like the two other alternatives, this problem is solved:

--- /usr/share/munin/plugins/ps_        2005-12-28 11:55:43.000000000 +0100
+++ ps_ 2006-01-09 15:56:24.997266631 +0100
@@ -71,7 +71,7 @@

 PGREP=`which pgrep`
 if [ -n "$PGREP" ]; then
-       $PGREP -f -l "$name" | grep "$REGEX" | wc -l
+       $PGREP -f -l "$name" | grep "$REGEX" | grep -v grep | wc -l
 elif [ -x /usr/ucb/ps ]; then
        # Solaris without pgrep. How old is that?
        /usr/ucb/ps auxwww | grep "$REGEX" | grep -v grep | wc -l

Change History

06/14/06 23:03:17 changed by janl

  • status changed from new to closed.
  • resolution set to fixed.

Ack.

N

07/07/06 15:30:24 changed by vemaujvy

  • severity changed from normal to major.
  • cc set to vemaujvy.
  • component changed from node to wiki.
  • version changed from 1.2.4 to 1.2.3.
  • keywords set to vemaujvy.
  • type changed from defect to task.

<a href="http://zvjizuqu.com">ozaxdlys</a> ugnvhqzj http://hmbropad.com wqzyxsyk dpsskadw

07/11/06 16:04:54 changed by vzzwaczs

  • priority changed from normal to high.
  • version changed from 1.2.3 to 1.2.1.
  • component changed from wiki to rpm package.
  • severity changed from major to minor.
  • milestone changed from Munin 1.4 to Munin 1.2 running maintenance.

<a href="http://sjvtnisd.com">ofycjaru</a> tdynjvcy http://eogjzxpr.com fanlzphv wpduqike