sqshq / sampler

Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.

Home Page:https://sampler.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wrong results of sample commands

fthommen opened this issue · comments

Hi,

the following sample commands yield wrong results in sampler:

  • /usr/bin/ps -ef | grep mbatchd | grep -v grep | wc -l consistently results in one more than the number of mbatchd processes
  • /usr/bin/ps -eLf | grep 'mbatchd' | grep -v 'grep' | wc -l results in around 20 to 30 more than the number of mbatchd threads

The whole configuration block looks like

runcharts:
  - title: mbatchd processes and threads
    position: [[0, 0], [45, 19]]
    rate-ms: 2000
    legend:
        enabled: true
        details: true
    scale: 0
    items:
      - label: mbatchd processes
        sample: /usr/bin/ps -ef | grep mbatchd | grep -v grep | wc -l
      - label: mbatchd threads
        sample: /usr/bin/ps -eLf | grep 'mbatchd' | grep -v 'grep' | wc -l

Any idea what could be the problem? Is there a way to see, how sampler evaluates the sample commands?