Announcement

Collapse
No announcement yet.

Cannot get SNMP Traps to work in Centreon

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot get SNMP Traps to work in Centreon

    Hello everybody,

    So I've been trying to monitor a Wifi Hotspot (netgear WNAP320) but can't get my snmp traps to show in Centreon. I've been reading a lot of forums and documentations, but I'm very new to all this, and there is no one to help me where I work, so I really need some help to figure it out.

    I've got two machines, one for development, one for production, and can't get either of them to show the traps.
    I imported the MIB and followed instructions from https://documentation.centreon.com/d...ation/02k.html, but both of my centreon fails in different ways.

    I know that both of them receive traps because I can see them when I type "tcpdump -i eth0 -u port 161" in command line

    My first machine, the one for development, is running CentOS 6.6, and my service created for the traps always shows me the Status "OK" and "No" for status information.
    When I type in "/etc/init.d/snmptrapd status" I get "snmptrapd (pid 1218) is running". (same for snmpd)
    I've tried running centreontrapd as I've seen in another topic, it showed something once, the status changed, but now it went back to "OK" and "No", and no matter what I do the status won't change again.
    I've tried running centreontrapdforward and it does nothing.
    Both of them get me "Can't find extra config file /etc/centreon/centreontrapd.pm", but I've seen somewhere that it should not be a problem. Should I create the file ? If yes, how ?

    I think something is wrong with the config files, but the more I read about it the more I get confused and the less I know where to search.

    For the second machine, it's waay more complicated, and I really need it to work. It's running Ubuntu 10.04, with Centreon (I don't know which version, can't find how to get it but seems like 2)
    On this one the service always shows a "Critical" status (no idea why) and "(null)" in status information...
    When I type "/etc/init.d/snmpd status" I get "* snmpd is running \n * snmptrapd is not running" so I guess it's not good... but I have absolutely no idea on how to start it... everything I tried failed.
    On top of that, when I try to access some configurations files like shown in documentations, it's always a dead end, seems like everything has been moved around.

    I've tried lots of things, probably most of it irrelevant, and I probably forgot tons of important informations for you to help me, so if you have any questions, shoot, I will try to answer it the best I can.

    And don't hesitate to treat me like I'm five, because I'm not very good at this.

    Thank you for your time and your help in advance.
    Last edited by AlgoDev; 28 October 2015, 17:06. Reason: added tags

  • #2
    Hello again,

    I gave up on my dev machine (it should work as I followed the doc line by line, but whatever, not the same issue so I don't need to get worked up about that), I need to focus on the real problem here :

    I managed to successfully configure snmptrapd to run ; now if I've understood well, the trap is sent to snmptt and I think it doesn't work like it should :

    When I do /usr/local/centreon/bin/snmptt I get:
    Code:
    Config file could not be loaded
    And when I do ".../snmptt --ini=/etc/snmp/centreon_traps/snmptt.ini" it runs for ever but I get nothing.

    I looked through snmptt.ini but everything seems fine... as far as I can tell.

    Can someone help please ? I've gone through every forums and docs I could find, but I'm just stuck on all thes config files and process...

    (I speak french if needed).

    Thanks
    Last edited by AlgoDev; 17 November 2015, 15:47.

    Comment


    • #3
      So new update in case someone catch the train,

      I've fixed my issue with snmptt, now all traps do go to /var/log/snmptt.log and /var/log/snmpttunknown.log as it should (depending on the mibs)

      BUT I still can't get centreon to update on this machine.

      I've tried to monitor through tail -f /usr/local/nagios/var/nagios.log but I don't get anything.

      I've made sure that centTrapHandler-2.x is configured well, as it shows :

      Code:
      $cmdFile = "/var/lib/centreon/centcore.cmd";
      $etc = "/etc/centreon";
      And when I type :
      Code:
      /usr/local/centreon/bin/centTrapHandler-2.x IPofTheStation nameOfTheStation .1.3.6.1.6.3.1.1.5.3 "Link down"
      I get :
      Code:
      Use of uninitialized value $allargs in split at ./centTrapHandler-2.x line 251.
      and it asks for the password (which I don't have); but I don't get any message when I add sudo in front.

      I think that centTrapHandler is the problem, but not sure at all. I've tried almost all I could manage, searched all the internet, but found nothing...

      Please, help me !

      Comment


      • #4
        I finally got it right !

        I don't think anyone would be in the same situation I am, since we use a very obsolete version of centreon, but just in case, here is what fixed it :

        In centreon, I went to Configuration > Nagios > nagios.cfg > External command file and found that it was not centcore as written in centTrapHandle-2.x but "/usr/local/nagios/var/rw/nagios.cmd"

        So I edited centTrapHandle-2.x and changed variable $cmdFile to nagios.cmd, restarted services and miracle !

        It finally worked.

        Hope this helps someone, someday !

        Comment


        • #5
          Hi AlgoDev

          Thank you very much. This was very usufull.

          Comment

          Working...
          X