Hello,

I have a custom check_snmp check that I use for Nagios that works great when called via the command line, but when used with the embedded perl interpreter in Nagios I am getting an error showing that the "Service check did not exit properly."

I turned on debugging on the embedded perl for Nagios and found that the embedded Perl interpreter cannot find Net::SNMP in @INC. However, I have verified that it is indeed in my path, and it is the latest version...

ERROR:
Wed Mar 14 17:36:59 2012 eval_file: syntax error in /usr/local/nagios/libexec/check_snmp.pl: "Can't locate Net/SNMP.pm in @INC (@INC contains:
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at (eval 2) line 9, BEGIN failed--compilation aborted at (eval 2) line 16.".

NET::SNMP in my @INC...
root@server Net# pwd
/usr/lib/perl5/site_perl/5.8.8/Net
root@venda Net# ls
SNMP SNMP.pm

CONFIRMING LATEST VERSION OF NET::SNMP for Perl
root@server Net-SNMP-v6.0.1# yum install net-snmp-perl.x86_64 Loaded plugins: product-id, security, subscription-manager Updating Red Hat repositories.
Setting up Install Process
Package 1:net-snmp-perl-5.3.2.2-14.el5_7.1.x86_64 already installed and latest version
Nothing to do

CHECK RUNNING VIA COMMAND LINE
root@server ~# /usr/local/nagios/libexec/check_snmp.pl -H <IPADDRESS> -C -w 90 -c 95
OK 1% load

Does anyone have any experience with this?


In reply to Help with Embedded Perl - Nagios by smford22

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.