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

fix some script warning and error #32

Closed
wants to merge 3 commits into from
Closed

fix some script warning and error #32

wants to merge 3 commits into from

Conversation

lxf1992521
Copy link

No description provided.

@Tontonitch
Copy link
Owner

Hello,
Why not valid on centos 6/7?
Could be that the perl binary location (/usr/bin ?) is not in your PATH environment variable.

@Tontonitch
Copy link
Owner

for the "fix perl regex warning", what is the warning message you receive?

@Tontonitch Tontonitch self-assigned this Jun 22, 2018
@lxf1992521
Copy link
Author

lxf1992521 commented Jun 22, 2018

  1. perl script interpreter error
    if using ''#!/usr/bin/env perl -w", will give the error:
    ——————————————————————————————————
    $ /usr/lib64/nagios/plugins/check_interface_table_v3t
    /usr/bin/env: perl -w: No such file or directory
    ——————————————————————————————————
    and after google, you will find this interpreter will not vaild in centos 6/7,at least.

2.fix perl regex warning
——————————————————————————————————
$ /usr/lib64/nagios/plugins/check_interface_table_v3t > /dev/null
\1 better written as $1 at /usr/lib64/interfacetable_v3t/SnmpUtils.pm line 743.
\2 better written as $2 at /usr/lib64/interfacetable_v3t/SnmpUtils.pm line 743.
——————————————————————————————————

@Tontonitch
Copy link
Owner

Ok for the regex.

For the 1st point, I use RedHat 7 (= CentOS 7) and no issue. Your error message says that the perl binary cannot be found using the PATH variable.

[root@monitorsrv1 ~]# /usr/bin/env toto
/usr/bin/env: toto: No such file or directory
[root@monitorsrv1 ~]#
[root@monitorsrv1 ~]# /usr/bin/env perl -v

This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 33 registered patches, see perl -V for more detail)

Copyright 1987-2012, 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.

[root@monitorsrv1 ~]#
[root@monitorsrv1 ~]# which perl
/usr/bin/perl
[root@monitorsrv1 ~]#
[root@monitorsrv1 ~]# env | grep PATH | grep "/usr/bin"
PATH=/root/perl5/bin:/opt/rh/rh-php71/root/usr/bin:/opt/rh/rh-php71/root/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[root@monitorsrv1 ~]#

@lxf1992521
Copy link
Author

——————————————————————————————————
$ lsb_release -d
Description: CentOS release 6.4 (Final)
$ echo '#!/usr/bin/env perl -v' > a.pl && chmod +x a.pl && ./a.pl
/usr/bin/env: perl -v: No such file or directory
——————————————————————————————————

——————————————————————————————————
$ lsb_release -d
Description: CentOS Linux release 7.4.1708 (Core)
$ echo '#!/usr/bin/env perl -w' > a.pl && chmod +x a.pl && ./a.pl
/usr/bin/env: perl -w: No such file or directory
——————————————————————————————————

@lxf1992521
Copy link
Author

Yes, I found "favicon.ico" 404 request in apache logs, so fix with it.

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

Successfully merging this pull request may close these issues.

None yet

2 participants