check_cpu

Frank, Jason JasonFrank at srcp.com
Wed Aug 10 00:40:11 CEST 2005


Check out the #! line and make sure it points to the right program (i.e.
/usr/bin/python exists), and that there's not any white space (including
pesky ^M's from Windows...)

Jason

-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Chris
Stankaitis
Sent: Tuesday, August 09, 2005 2:42 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] check_cpu

Hello I am trying to get Nemir's check_cpu python script running... I
had to tweak it a bit to get it to report the right CPU idle reading
under RHEL3, and Solaris, and it's working great with one exception...

when I try and run the program from cmd line it's saying it can't find
the python interperter.

[root at netops.dw plugins]# which python
/usr/bin/python
[root at netops.dw plugins]# head check_cpu.py #!/usr/bin/python



import string, os, sys, re
##from optik import OptionParser
from optparse import OptionParser



#######################################
###  Define a set of strings to handle
###  any info output requirements.



[root at netops.dw plugins]# ll check_cpu.py
-rwxr-xr-x    1 root     root         5566 Aug  9 19:35 check_cpu.py
[root at netops.dw plugins]# ./check_cpu.py -w 10 -c 5
: bad interpreter: No such file or directory [root at netops.dw plugins]#


if I run it wrapped around python it works fine..

# python check_cpu.py -w 10 -c 5
OK: CPU is 57% idle


any thoughts on where I am going wrong?


--Chris


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices Agile & Plan-Driven Development * Managing Projects & Teams *
Testing & QA Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when
reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list