• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Nagios monitoring of PFsense interfaces

General pfSense Questions
2
12
1.4k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    marion.miller
    last edited by Sep 21, 2022, 2:55 PM

    I am trying to monitor pfsense gateways with a nagios server. I seem to have everything setup fine since these commands work

    sudo /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_load
    sudo /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_users

    but when I try

    sudo /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_ifstatus -a Lan

    I get "NRPE: Unable to read output"

    I have added the check_ifstatus command into pfsense's NRPE settings. Any ideas?

    Thanks in advance.

    1 Reply Last reply Reply Quote 0
    • S
      stephenw10 Netgate Administrator
      last edited by Sep 22, 2022, 1:17 PM

      Was is the command? Does it run locally? Can you see what it's returning?

      'Lan' there looks a bit suspicious. I expect that to be LAN or lan. Unless that's not the interface but some parameters.

      Steve

      M 1 Reply Last reply Sep 22, 2022, 1:48 PM Reply Quote 0
      • M
        marion.miller @stephenw10
        last edited by Sep 22, 2022, 1:48 PM

        @stephenw1You are correct, it should be LAN. it fails with that also. the command is check_ifstatus. I want to know when an interface goes down.

        1 Reply Last reply Reply Quote 0
        • S
          stephenw10 Netgate Administrator
          last edited by Sep 22, 2022, 3:16 PM

          Ah, it;'s because:

          [2.6.0-RELEASE][admin@cedev-6.stevew.lan]/usr/local/libexec/nagios: ./check_ifstatus 
          Can't locate Net/SNMP.pm in @INC (you may need to install the Net::SNMP module) (@INC contains: /usr/local/libexec/nagios /usr/local/lib/perl5/site_perl/mach/5.32 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.32/mach /usr/local/lib/perl5/5.32) at ./check_ifstatus line 41.
          BEGIN failed--compilation aborted at ./check_ifstatus line 41.
          

          Looking.....

          M 1 Reply Last reply Sep 22, 2022, 3:27 PM Reply Quote 0
          • M
            marion.miller @stephenw10
            last edited by Sep 22, 2022, 3:27 PM

            @stephenw10 INstalled Net-SNMP and enabled in on pfsense and get the same error.

            1 Reply Last reply Reply Quote 0
            • S
              stephenw10 Netgate Administrator
              last edited by Sep 22, 2022, 4:00 PM

              Yeah, you need that package to get the SNMP perl module. But it appears to be in the correct location. Or at least a location that is referenced by the INC file. It should find it....

              1 Reply Last reply Reply Quote 0
              • S
                stephenw10 Netgate Administrator
                last edited by Sep 22, 2022, 4:23 PM

                No, it is looking in the wrong place.

                Try:

                ln /usr/local/lib/perl5/site_perl/mach/5.32/SNMP.pm /usr/local/lib/perl5/5.32/Net/SNMP.pm
                

                Then retest.

                1 Reply Last reply Reply Quote 0
                • S
                  stephenw10 Netgate Administrator
                  last edited by Sep 22, 2022, 4:31 PM

                  https://redmine.pfsense.org/issues/13509

                  M 1 Reply Last reply Sep 28, 2022, 3:19 PM Reply Quote 0
                  • M
                    marion.miller @stephenw10
                    last edited by Sep 28, 2022, 3:19 PM

                    Getting closer. It recognizes it but now gives these errors

                    Subroutine AUTOLOAD redefined at /usr/local/lib/perl5/site_perl/mach/5.32/SNMP.pm line 53.
                    Subroutine register_debug_tokens redefined at /usr/local/lib/perl5/site_perl/mach/5.32/SNMP.pm line 138.
                    Subroutine getenv redefined at /usr/local/lib/perl5/site_perl/mach/5.32/SNMP.pm line 144.
                    Subroutine setenv redefined at /usr/local/lib/perl5/site_perl/mach/5.32/SNMP.pm line 150.
                    Subroutine setMib redefined at /usr/local/lib/perl5/site_perl/mach/5.32/SNMP.pm line 158.
                    Subroutine initMib redefined at /usr/local/lib/perl5/site_perl/mach/5.32/SNMP.pm line 169.
                    Subroutine addMibDirs redefined at /usr/local/lib/perl5/site_perl/mach/5.32/SNMP.pm line 186.
                    Subroutine addMibFiles redefined at /usr/local/lib/perl5/site_perl/mach/5.32/SNMP.pm line 195.
                    Subroutine loadModules redefined at /usr/local/lib/perl5/site_perl/mach/5.32/SNMP.pm line 205.
                    Subroutine unloadModules redefined at /usr/local/lib/perl5/site_perl/mach/5.32/SNMP.pm line 216.
                    Subroutine translateObj redefined at /usr/local/lib/perl5/site_perl/mach/5.32/SNMP.pm line 222.
                    Subroutine getType redefined at /usr/local/lib/perl5/site_perl/mach/5.32/SNMP.pm line 251.
                    Can't locate object method "session" via package "Net::SNMP" (perhaps you forgot to load "Net::SNMP"?) at /usr/local/libexec/nagios/check_ifstatus line 128.

                    1 Reply Last reply Reply Quote 0
                    • S
                      stephenw10 Netgate Administrator
                      last edited by Sep 28, 2022, 3:22 PM

                      That's after adding the symlink?

                      M 1 Reply Last reply Sep 28, 2022, 3:23 PM Reply Quote 0
                      • M
                        marion.miller @stephenw10
                        last edited by Sep 28, 2022, 3:23 PM

                        @stephenw10
                        Yes

                        1 Reply Last reply Reply Quote 0
                        • S
                          stephenw10 Netgate Administrator
                          last edited by Sep 28, 2022, 4:26 PM

                          Mmm, OK I replicated that. That clearly that is loaded though. Something in the perl config maybe. Someone more familiar with perl will need to look at it.

                          1 Reply Last reply Reply Quote 0
                          1 out of 12
                          • First post
                            1/12
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.