check_procs error 'unsupported option (BSD syntax)'
Re: check_procs error 'unsupported option (BSD syntax)'
Think it's openSuse:
openSUSE 11.4 „Celadon“
openSUSE 12.2 "Mantis"
openSUSE 12.3 "Dartmouth"
ThxIA
openSUSE 11.4 „Celadon“
openSUSE 12.2 "Mantis"
openSUSE 12.3 "Dartmouth"
ThxIA
Re: check_procs error 'unsupported option (BSD syntax)'
Now I am really confused. The plugins built fine on 11.4 and 12.2 and check_procs runs as expected. 11.4:
And just to show you that both of the commands work:
12.2 worked as well. We should look through your configure and compile log, maybe configure had an issue where it chooses the proper ps command for the system. Are these suse boxes up to date? Were there any customizations performed when it was installed?
At this point I am at a loss as I cannot reproduce this behavior at all.
Code: Select all
andy@linux-dll5:/tmp/nagios-plugins-master> cat /etc/*release
openSUSE 11.4 (x86_64)
VERSION = 11.4
CODENAME = Celadon
andy@linux-dll5:/tmp/nagios-plugins-master> ./plugins/check_procs
PROCS OK: 123 processes | procs=123;;;0;
andy@linux-dll5:/tmp/nagios-plugins-master> ./plugins/check_procs -w 5 -c 10 --metric=CPU
CPU OK: 123 processes | procs=123;;;0; procs_warn=0;;;0; procs_crit=0;;;0;
Code: Select all
andy@linux-dll5:/tmp/nagios-plugins-master> ps -ewo stat,uid,ppid,vsz,rss,pcpu,comm,args | head -5
STAT UID PPID VSZ RSS %CPU COMMAND COMMAND
Ss 0 0 12460 696 0.0 init init [5]
S 0 0 0 0 0.0 kthreadd [kthreadd]
S 0 2 0 0 0.0 ksoftirqd/0 [ksoftirqd/0]
S 0 2 0 0 0.0 kworker/0:0 [kworker/0:0]
andy@linux-dll5:/tmp/nagios-plugins-master> ps -ewo 'stat uid' | head -5
STAT UID
Ss 0
S 0
S 0
S 0
At this point I am at a loss as I cannot reproduce this behavior at all.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: check_procs error 'unsupported option (BSD syntax)'
Thanks @abrist for your investigation.
I really dont know, what is messy around my systems, because I installed from a image default by my provider. Think they using standard openSuSe repositories.
I'm playing around with the source code of "check_proc". So I first 'mark' the error printf to be sure, I found the correct place where the error is thrown.
Then I let printf the PS_COMMAND, that means: "ps -laxnwww"
Try this on the prompt:
Huh, that IS the "error", but I think this is NOT an error. "ps laxnwww" give the same output, except the warning.
OK, so I take a deeper look to the source, found PS_VARLIST and PS_FORMAT.
On my 12.2 System the #defines look like:
@12.3
First, the format description on 12.2 differs from the available variables (15 format descriptors and 8 variables?) like in source fo the 12.3 system.
Now I execute the "/usr/bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args'" on 12.2 (remeber, alternate syntax) and get the result:
Yippie!!!
In a transcendent multidimensional godlike inspiration
I replaced the #defines for PS_COMMAND, PS_VARLIST, PS_FORMAT with the values from the generated 12.3 code in config.h.
The PS_COMMAND I change to the alternativ syntax from
to
Then "make all" and !surprise
surprise!:
Doing the same on the 11.4 system, except to change the path to ps from /usr/bin/ps to /bin/ps, because there is no linked file "/usr/bin/ps -> /bin/ps". Same result of check_proc:
In my view, this is the correct output for check_procs, or I'm wrong? Can you please confirm the output?
I don't know why my ps is different from other systems, I swear I do nothing with the base installation! Sometimes I think linux is a shortcut for "Let It Not Useful Xtra"....
Thanks for all your help.
Lutz
I really dont know, what is messy around my systems, because I installed from a image default by my provider. Think they using standard openSuSe repositories.
I'm playing around with the source code of "check_proc". So I first 'mark' the error printf to be sure, I found the correct place where the error is thrown.
Then I let printf the PS_COMMAND, that means: "ps -laxnwww"
Try this on the prompt:
Code: Select all
# ps -laxnwww | head -5
warning: bad ps syntax, perhaps a bogus '-'?
See http://gitorious.org/procps/procps/blobs/master/Documentation/FAQ
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND
1 0 2 0 20 0 0 0 5f3f5 S ? 0:37 [kthreadd]
1 0 3 2 20 0 0 0 45be5 S ? 65:09 [ksoftirqd/0]
1 0 6 2 -100 - 0 0 ae0cd S ? 1:52 [migration/0]
1 0 7 2 -100 - 0 0 c546a S ? 0:44 [watchdog/0]
#OK, so I take a deeper look to the source, found PS_VARLIST and PS_FORMAT.
On my 12.2 System the #defines look like:
Code: Select all
#define PS_COMMAND "/usr/bin/ps -laxnwww"
#define PS_VARLIST &procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog
#define PS_FORMAT "%*s %d %d %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
Code: Select all
#define PS_COMMAND "/usr/bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args'"
#define PS_VARLIST procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos
#define PS_FORMAT "%s %d %d %d %d %d %f %s %n"
Now I execute the "/usr/bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args'" on 12.2 (remeber, alternate syntax) and get the result:
Code: Select all
# /usr/bin/ps axwo stat,uid,pid,ppid,vsz,rss,pcpu,comm,args | head -5
STAT UID PID PPID VSZ RSS %CPU COMMAND COMMAND
S 0 2 0 0 0 0.0 kthreadd [kthreadd]
S 0 3 2 0 0 0.0 ksoftirqd/0 [ksoftirqd/0]
S 0 6 2 0 0 0.0 migration/0 [migration/0]
S 0 7 2 0 0 0.0 watchdog/0 [watchdog/0]
#In a transcendent multidimensional godlike inspiration
The PS_COMMAND I change to the alternativ syntax from
Code: Select all
#define PS_COMMAND "/usr/bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args'"Code: Select all
#define PS_COMMAND "/usr/bin/ps axwo stat,uid,pid,ppid,vsz,rss,pcpu,comm,args"Code: Select all
12.2 # ./plugins/check_procs -w 5 -c 10 --metric=CPU
CPU CRITICAL: 1 crit, 0 warn out of 141 processes | procs=141;;;0; procs_warn=0;;;0; procs_crit=1;;;0;
12.2 #Code: Select all
11.4 # ./plugins/check_procs -w 5 -c 10 --metric=CPU
CPU OK: 151 processes | procs=151;;;0; procs_warn=0;;;0; procs_crit=0;;;0;
11.4 #I don't know why my ps is different from other systems, I swear I do nothing with the base installation! Sometimes I think linux is a shortcut for "Let It Not Useful Xtra"....
Thanks for all your help.
Lutz
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: check_procs error 'unsupported option (BSD syntax)'
I would agree that, that is correct output for the check_procs and confirm that it is slightly strange that simply adding commas between the arguments was the fix. We will keep this in mind for a future optional patch.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: check_procs error 'unsupported option (BSD syntax)'
Good News Friends!
I moved the check_procs from compile directory to /usr/lib/nagios/plugins and it works perfectly. Now I can can control the machines by a separate nagios server.
Cool thing and a create work and many many thanks to all nagios-supporters!
Problem solved with "little help from my friends"
Hope somebody else can use this thread to solve problems like this.
LL&P
Lutz aka Banzai
I moved the check_procs from compile directory to /usr/lib/nagios/plugins and it works perfectly. Now I can can control the machines by a separate nagios server.
Cool thing and a create work and many many thanks to all nagios-supporters!
Problem solved with "little help from my friends"
Hope somebody else can use this thread to solve problems like this.
LL&P
Lutz aka Banzai
Re: check_procs error 'unsupported option (BSD syntax)'
Glad to call you friendBanzai wrote:Problem solved with "little help from my friends"
Gonna go ahead and close this up now, good luck with everything!
Former Nagios employee
Re: check_procs error 'unsupported option (BSD syntax)'
Just as a heads up, you can actually declare the ps command at configure. A quick grep from the configure script:
Glad you figured it out, though it is strange that all 3 of the suse versions I tried worked just fine. Hopefully this is an edge case. . . If I could reproduce it, I could fix the configure process. . .
Code: Select all
[root@localhost nagios-plugins]# cat configure | grep with-ps
--with-ps-command=PATH Verbatim command to execute for ps
--with-ps-format=FORMAT Format string for scanning ps output
--with-ps-cols=NUM Number of columns in ps command
--with-ps-varlist=LIST Variable list for sscanf of 'ps' outputFormer Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
sagar_padamwar
- Posts: 1
- Joined: Thu Nov 06, 2014 11:02 pm
RESOLVED : check_procs error 'unsupported option (BSD syntax
Hi Guys, I too had same issue on rhel 6.1
[root@ttpmpjlrdevapp libexec]# ./check_procs -w 200 -c 300
System call sent warnings to stderr: ERROR: Unsupported option (BSD syntax)
I have Resolved this as below
1) Checked which package provides ps command
---------------------------------------------------------------------------------
[root@ttpmpjlrdevapp libexec]# yum provides /bin/ps
Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
rhel | 2.9 kB 00:00
procps-3.2.8-17.el6.x86_64 : System and process monitoring utilities
Repo : rhel
Matched from:
Filename : /bin/ps
procps-3.2.8-17.el6.x86_64 : System and process monitoring utilities
Repo : installed
Matched from:
Other : Provides-match: /bin/ps
---------------------------------------------------------------------------------
2) Reinstalled procps-3.2.8-17.el6.x86_64 using "yum reinstall procps-3.2.8-17.el6.x86_64"
and problem resolved
[root@ttpmpjlrdevapp libexec]# ./check_procs -w 200 -c 300
PROCS OK: 200 processes | procs=200;200;300;0;
[root@ttpmpjlrdevapp libexec]# ./check_procs -w 200 -c 300
System call sent warnings to stderr: ERROR: Unsupported option (BSD syntax)
I have Resolved this as below
1) Checked which package provides ps command
---------------------------------------------------------------------------------
[root@ttpmpjlrdevapp libexec]# yum provides /bin/ps
Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
rhel | 2.9 kB 00:00
procps-3.2.8-17.el6.x86_64 : System and process monitoring utilities
Repo : rhel
Matched from:
Filename : /bin/ps
procps-3.2.8-17.el6.x86_64 : System and process monitoring utilities
Repo : installed
Matched from:
Other : Provides-match: /bin/ps
---------------------------------------------------------------------------------
2) Reinstalled procps-3.2.8-17.el6.x86_64 using "yum reinstall procps-3.2.8-17.el6.x86_64"
and problem resolved
[root@ttpmpjlrdevapp libexec]# ./check_procs -w 200 -c 300
PROCS OK: 200 processes | procs=200;200;300;0;
Re: check_procs error 'unsupported option (BSD syntax)'
Recovering ps command helped me on Ubuntu http://askubuntu.com/questions/144954/r ... ps-command
I just did:
apt-get install --reinstall procps
and that resolved my problem.
I just did:
apt-get install --reinstall procps
and that resolved my problem.