#73 closed task (fixed)

Bug i ps_ plugin on systems using pgrep

Reported by: runesk@… Owned by: 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 (3)

comment:1 Changed at 2006-06-14T23:03:17+02:00 by janl

  • Resolution set to fixed
  • Status changed from new to closed

Ack.

N

comment:2 Changed at 2006-07-07T15:30:24+02:00 by vemaujvy

  • Cc vemaujvy added
  • Component changed from node to wiki
  • Keywords vemaujvy added
  • Severity changed from normal to major
  • Type changed from defect to task
  • Version changed from 1.2.4 to 1.2.3

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

comment:3 Changed at 2006-07-11T16:04:54+02:00 by vzzwaczs

  • Component changed from wiki to rpm package
  • Milestone changed from Munin 1.4 to Munin 1.2 running maintenance
  • Priority changed from normal to high
  • Severity changed from major to minor
  • Version changed from 1.2.3 to 1.2.1

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

Note: See TracTickets for help on using tickets.