Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect location of [ sudo lsof awk wc ] #1

Open
box293 opened this issue Aug 30, 2016 · 1 comment
Open

Detect location of [ sudo lsof awk wc ] #1

box293 opened this issue Aug 30, 2016 · 1 comment

Comments

@box293
Copy link

box293 commented Aug 30, 2016

Might be good to detect the location of the files:

sudo
lsof
awk
wc

Using CentOS 6.x, the first time I tried to run it I got:

!!! command failure !!! Username wrong

I installed lsof and changed the script to:

LSOF=/usr/sbin/lsof

Then when I tried to run it I got the errors:

./nagios_check_open_files.sh: line 36: /bin/sudo: No such file or directory
./nagios_check_open_files.sh: line 38: /bin/wc: No such file or directory
./nagios_check_open_files.sh: line 38: /bin/sudo: No such file or directory
(standard_in) 1: syntax error
./nagios_check_open_files.sh: line 42: [: -lt: unary operator expected
./nagios_check_open_files.sh: line 46: [: -ge: unary operator expected
./nagios_check_open_files.sh: line 49: [: -ge: unary operator expected

Once I updated these:

SUDO=/usr/bin/sudo
WC=/usr/bin/wc

It ran just fine:

./nagios_check_open_files.sh nagios

FILES OK - 18 % with 762 files open|files=762;;;
@wefixit-AT
Copy link
Owner

Thanks for reporting, this is a good idea.
I will build this into the check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants