pt-stalk top -bn1 causes an error on CentOS

Bug #1103705 reported by Fernando Ipar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Invalid
Undecided
Daniel Nichter

Bug Description

At least on CentOS, the following command as included in pt-stalk:

top -bn1

Causes this error:

top: invalid option -- 1

top -bn 1

(with a space in the middle) works as expected:

last pid: 10426; load avg: 0.01, 0.01, 0.00; up 12+22:07:54 21:40:17
371 processes: 1 running, 370 sleeping
CPU states: 0.0% user, 0.0% nice, 0.0% system, 100% idle, 0.0% iowait
Kernel: 166 ctxsw, 1048 intr
Memory: 18G used, 171G free, 338M buffers, 6403M cached
Swap: 3148K used, 1291M free, 1484K cached

  PID USERNAME THR PRI NICE SIZE RES SHR STATE TIME CPU COMMAND
 2147 root 1 10 -5 0K 0K 0K sleep 15:10 0.00% kswapd0
 (...)

This is on:

CentOS release 5.6 (Final)

Changed in percona-toolkit:
importance: Undecided → High
status: New → In Progress
assignee: nobody → Daniel Nichter (daniel-nichter)
milestone: none → 2.1.9
tags: added: pt-stalk syntax-error
summary: - -1 causes an error while invoking top from pt-stalk
+ pt-stalk top -bn1 causes an error on CentOS
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

It works on CentOS 5.8 for the record.

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

I can't reproduce this:

[vagrant@localhost ~]$ cat /etc/redhat-release
CentOS release 5.6 (Final)

[vagrant@localhost ~]$ cat foo.sh
#!/usr/bin/env bash

top -bn1

[vagrant@localhost ~]$ ./foo.sh
top - 11:26:20 up 7 min, 1 user, load average: 0.42, 0.35, 0.19
...

Changed in percona-toolkit:
milestone: 2.1.9 → none
importance: High → Undecided
Revision history for this message
Fernando Ipar (fipar) wrote : Re: [Bug 1103705] pt-stalk top -bn1 causes an error on CentOS

Daniel,

I realized this happens with top 3.8 beta. It works fine on CentOS with top 3.2.7
You can just close, I'll patch the version used by this customer but I don't think this will affects others.

Thanks,
Fernando.

Changed in percona-toolkit:
status: In Progress → Invalid
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-1069

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.