Code: Select all
su - -s /bin/bash nagios '/usr/lib64/nagios/plugins/check_open_files.pl -w 85 -c 95'
echo $?Code: Select all
su - nagios -c "/usr/lib64/nagios/plugins/check_open_files.pl -w 85 -c 95"
echo $?Code: Select all
su - -s /bin/bash nagios '/usr/lib64/nagios/plugins/check_open_files.pl -w 85 -c 95'
echo $?Code: Select all
su - nagios -c "/usr/lib64/nagios/plugins/check_open_files.pl -w 85 -c 95"
echo $?Code: Select all
[root@dc01-cache-01 plugins]# ./check_open_files.pl -w 85 -c 95
OK: 928 open files (0% of max 1000000)|opened_files=928;850000;950000
Code: Select all
[root@dc01-cache-01 plugins]# su - -s /bin/bash nagios /usr/lib64/nagios/plugins/check_open_files.pl -w 85 -c 95
su: invalid option -- 'w'
Try `su --help' for more information.Code: Select all
su -l -s /bin/bash nagios /usr/lib64/nagios/plugins/check_open_files.pl
/usr/lib64/nagios/plugins/check_open_files.pl: line 3: use: command not found
/usr/lib64/nagios/plugins/check_open_files.pl: line 4: syntax error near unexpected token `('
/usr/lib64/nagios/plugins/check_open_files.pl: line 4: `use vars qw($opt_h $PROGNAME $opt_w $opt_c $opt_t $opt_vi $msg $state);'
Code: Select all
su -l -s /bin/bash nagios -c "which perl"
su -l -s /bin/bash nagios -c "perl --version"
Code: Select all
[root@dc01-cache-01 ~]# su -l -s /bin/bash nagios -c "which perl"
/usr/bin/perl
[root@dc01-cache-01 ~]# su -l -s /bin/bash nagios -c "perl --version"
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
Copyright 1987-2009, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
Code: Select all
usermod -s /bin/bash nagios
su nagios
/usr/lib64/nagios/plugins/check_open_files.pl -w 85 -c 95
echo $?Code: Select all
[root@dc01-cache-01 ~]# usermod -s /bin/bash nagios
[root@dc01-cache-01 ~]# su nagios
bash-4.1$ /usr/lib64/nagios/plugins/check_open_files.pl -w 85 -c 95
Can't locate utils.pm in @INC (@INC contains: /usr/local/nagios/libexec /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/lib64/nagios/plugins/check_open_files.pl line 6.
BEGIN failed--compilation aborted at /usr/lib64/nagios/plugins/check_open_files.pl line 6.
bash-4.1$ echoCode: Select all
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum -y install nagios nagios-plugins-all nrpe
chkconfig nagios on
/usr/lib64/nagios/plugins/utils.pmslansing wrote:Does the file "utils.pm" exist in your plugin directory?
slansing wrote:I'd be interested in seeing it's USE definition
Code: Select all
use Getopt::Long;
use vars qw($opt_h $PROGNAME $opt_w $opt_c $opt_t $opt_vi $msg $state);
use lib "/usr/local/nagios/libexec";
use utils qw(%ERRORS &print_revision &support &usage );
Code: Select all
use lib "/usr/local/nagios/libexec";Code: Select all
use lib "/usr/lib64/nagios/plugins/";brandon.pal wrote:Then run the commands lmiltchev posted above, again, thanks!
Code: Select all
[root@dc01-cache-01 ~]# su nagios
bash-4.1$ /usr/lib64/nagios/plugins/check_open_files.pl -w 85 -c 95
OK: 1408 open files (0% of max 1000000)|opened_files=1408;850000;950000
bash-4.1$ echo $?
0I'll be honest. I have no idea how to do that.brandon.pal wrote:That's why I usually recommend compiling the plugins by hand.