I'm trying to use nmap2nagios (a perl script) on CentOS, but when I run it, I get the following error: (If this is offtopic for this list, please let me know) ./nmap2nagios.pl -v -r /tmp/nmap.xml -o /tmp/new.cfg ./nmap2nagios.pl: line 9: use: command not found ./nmap2nagios.pl: line 10: use: command not found ./nmap2nagios.pl: line 11: use: command not found ./nmap2nagios.pl: line 14: use: command not found ./nmap2nagios.pl: line 15: ::Dumper::Indent: command not found ./nmap2nagios.pl: line 16: ::Dumper::Maxdepth: command not found ./nmap2nagios.pl: line 18: use: command not found ./nmap2nagios.pl: line 19: use: command not found ./nmap2nagios.pl: line 20: use: command not found ./nmap2nagios.pl: line 22: use: command not found ./nmap2nagios.pl: line 24: use: command not found ./nmap2nagios.pl: line 26: my: command not found ./nmap2nagios.pl: line 29: syntax error near unexpected token `=' ./nmap2nagios.pl: line 29: ` $data_ref->{'Path'}) = fileparse($0);' [root at localhost nmap2nagios-0.1.2]# When I type in "perl" before the command, I get this: [root at localhost nmap2nagios-0.1.2]# perl nmap2nagios.pl -v -r /tmp/nmap.xml -o /tmp/new.cfg Can't locate XML/Simple.pm in @INC (@INC contains: /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at nmap2nagios.pl line 24. BEGIN failed--compilation aborted at nmap2nagios.pl line 24. [root at localhost nmap2nagios-0.1.2]#
On Fri, Oct 26, 2007 at 11:34:39AM -0700, Rogelio alleged:> When I type in "perl" before the command, I get this: > > [root at localhost nmap2nagios-0.1.2]# perl nmap2nagios.pl -v -r > /tmp/nmap.xml -o /tmp/new.cfg > > Can't locate XML/Simple.pm in @INC (@INC contains:'yum install perl-XML-Simple' and try that again. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20071026/9714d0d2/attachment-0004.sig>
Does nmap2nagios have: #!/usr/bin/perl at the top. It looks like bash is interpreting the script. Try: perl nmap2nagios.pl (rest of options) ...james On 10/26/07, Rogelio <scubacuda at gmail.com> wrote:> I'm trying to use nmap2nagios (a perl script) on CentOS, but when I > run it, I get the following error: > > (If this is offtopic for this list, please let me know) > > ./nmap2nagios.pl -v -r /tmp/nmap.xml -o /tmp/new.cfg > > ./nmap2nagios.pl: line 9: use: command not found > ./nmap2nagios.pl: line 10: use: command not found > ./nmap2nagios.pl: line 11: use: command not found > ./nmap2nagios.pl: line 14: use: command not found > ./nmap2nagios.pl: line 15: ::Dumper::Indent: command not found > ./nmap2nagios.pl: line 16: ::Dumper::Maxdepth: command not found > ./nmap2nagios.pl: line 18: use: command not found > ./nmap2nagios.pl: line 19: use: command not found > ./nmap2nagios.pl: line 20: use: command not found > ./nmap2nagios.pl: line 22: use: command not found > ./nmap2nagios.pl: line 24: use: command not found > ./nmap2nagios.pl: line 26: my: command not found > ./nmap2nagios.pl: line 29: syntax error near unexpected token `=' > ./nmap2nagios.pl: line 29: ` $data_ref->{'Path'}) = fileparse($0);' > [root at localhost nmap2nagios-0.1.2]# > > When I type in "perl" before the command, I get this: > > [root at localhost nmap2nagios-0.1.2]# perl nmap2nagios.pl -v -r > /tmp/nmap.xml -o /tmp/new.cfg > > Can't locate XML/Simple.pm in @INC (@INC contains: > /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5 > /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi > /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi > /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi > /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi > /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi > /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi > /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 > /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 > /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 > /usr/lib/perl5/site_perl > /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi > /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi > /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi > /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi > /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi > /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi > /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 > /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 > /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 > /usr/lib/perl5/vendor_perl .) at nmap2nagios.pl line 24. > BEGIN failed--compilation aborted at nmap2nagios.pl line 24. > [root at localhost nmap2nagios-0.1.2]# > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >