How to enable basic ping testing in LibreNMS

In a previous post I looked at how to install LibreNMS which is easily one of the most straightforward network monitoring tools around. It’s easy to use, works out of the box, and is really pretty to look at. In this post I’ll look at how to enable ping monitoring non-snmp devices.

Update: In a previous revision I stated that you could also enable alerting on services. Currently that doesn’t look like it is possible. I’d add that information back here if I can figure it out.

Whilst most devices now-a-days provide SNMP management there are still a tonne of devices which either don’t support SNMP or where you just don’t need to manage them. Those devices may still need monitoring though and a simple alert when a device goes offline is something that’s very straightforward to set up.

  1. LibreNMS has no inbuilt ping support, it only supports SNMP enabled devices, so we’re going to make use of the Nagios Plugin set to provide additional monitoring. SSH on to your LibreNMS server and lets install the plugins.[code]sudo apt-get install nagios-plugins[/code]
  2. Once they are installed, you’ll need to enable support for the plugins in LibreNMS.[code]sudo emacs /opt/librenms/config.php[/code]
  3. Add the following lines to the bottom of your LibreNMS config.php file and save.[code]$config[‘show_services’] = 1;
    $config[‘nagios_plugins’] = “/usr/lib/nagios/plugins”;[/code]
  4. Now you just need to ensure that the ICMP nagios check file is enabled for execution by LibreNMS. The command and output should look like this. You need to be able to see the x in the permission string at the start of the line.[code]ls /usr/lib/nagios/plugins/check_icmp -l
    -rwsr-xr-x 1 root root 59440 Mar 12 2014 check_icmp[/code]
  5. Finally, you need to make sure that the services checks are run. Edit the /etc/cron.d/librenms file and make sure the following line is at the bottom before saving.[code]*/5 * * * * librenms /opt/librenms/check-services.php >> /dev/null 2>&1[/code]
  6. Pop over to your LibreNMS web portal and hit Refresh. You should see a services menu appear. This is where you will manage all the non-snmp checks.
    LibreNMS Services
  7. Click Add Service to add a new service check.
  8. The Device is the IP of the machine that *does* the check. In our case use your LibreNMS IP address. Set the type to ICMP and enter the IP address to be pinged in the IP Address box. Click Add Service. Note: You *MUST* enter a description otherwise managing multiple alerts becomes an absolute nightmare.
  9. Click on Services > All Services to see your list of services. You should now see your new ping test there.
    LibreNMS Services

What is your reaction?

Strongly Agree
Strongly Disagree

You may also like


  1. Thanks for useful article, I was missing this function in LibreNMS.. As I’m a beginner, I have a question:
    On last screenshot you have service ICMP, not PING. When I select ICMP, it doesn’t refresh. When I select PING, I get an error “was not set check_ping: Could not parse arguments
    check_ping -H -w ,% -c ,%
    [-p packets] [-t timeout] [-4 .. “.

    Any hint or explanation?


    1. Hi Carl

      It’s definitely ICMP that you want to choose. I’ve attached a copy of my service overview screen.

      Did you do step 4 and type in the following?

      ls /usr/lib/nagios/plugins/check_icmp -l

      You should see some small x’s next to the check_icmp entry which show that it’s executable. If you don’t see the X’s then type …

      sudo chmod ugo+x /usr/lib/nagios/plugins/check_icmp

      Give that a go and see if it works.

      1. Thanks for fast reply.

        First I have tried ‘ping’ service, as displayed on screenshot #2, but that doesn’t work, returns error. So according to your last scrshot I figured out I should try ICMP.

        file check_icmp is :
        -rwxr-xr-x 1 root root 59504 Dec 3 2014 check_icmp
        ..which should be OK (Debian 8).

        What troubles me is the static state of information (seems it did the ping once when I added the service and never since then).

        When setting up the service in device selection I choose localhost, IP Addr is the target device.



        1. Hi Karel

          It sounds like things are working now but perhaps step 5 hasn’t been done.

          Step 5 shows the line that should be pasted in to your /etc/cron.d/librenms file which triggers a script to run every 5 minutes.

          If you wait 5 mins or so and you aren’t seeing the Last Check column of your services update then perhaps something is wrong with your crontab setup for LibreNMS. That might be a bit beyond the kind of help I can give you here.

          1. OK, I’ll check the cron somehow, thanks for tip. I guess I’ll solve it somehow, thanks for help and for article once more.


          2. One other thing to try is to set up an ICMP service check and point it at a machine you can get to. Wait 5 or so minutes for the check to show as successful and then turn off that machine. See if you get an alert.

            I’ve set up a test box here and I can see that the Last Check column doesn’t always reflect a change despite me getting an alert from the service check.

            They are working on an update to the service check handling at the moment to make it fit more nicely with the rest of LibreNMS and have some reporting and graphing. Hopefully it will get there soon.

          3. 1st of all thanks for this post, exactly what I was looking for.
            Although the graphs don’t seem to be created (the graph shows but doesnt display any data).

            I’ d like to allow the view of this graph to limited users, just like we can grant access to ports or devices..
            Do you have any idea to integrate this with authentication ?

          4. Hi Pepe

            Thanks for reading the post 🙂

            The main thing to remember about the Ping/ICMP tests are that they aren’t actually handled by LibreNMS. It just calls a plugin which returns some stuff. At the moment that return isn’t graphed by LibreNMS, they are working on it though. You just get the text based ping response time

            The user question is a great one. I’ll knock together a post about that today. However in general you create a new user in the Settings (cog) menu. Make him a normal user. Then edit their permissions and assign that user the ports you want them to access. They will see only those ports and their graphs.


      2. How can I add a device without LibreNMS checking for SNMP? I have several that don’t have SNMP, and I just want to do a ping check.

        1. Hi Refalm

          These instructions should get you going for now. At the moment LibreNMS doesn’t have any inbuilt support for non-snmp devices. A device has to be checked for SNMP before it’s added.

          It gets around this by using Nagios Plugins which support a range of checks against a range of devices, some of which are supported by LibreNMS.

          It does mean that you have to install these plugins by hand and do a small amount of manual tweaking, though if you’ve managed to install LibreNMS on a Linux box then the above instructions should be fairly straightforward.

          Moving forward LibreNMS are working on better integration with the Nagios Plugins so that you can more easily add ping checks and see graphs of results and the like.


Leave a reply

Your email address will not be published. Required fields are marked *

The reCAPTCHA verification period has expired. Please reload the page.

More in:Ubuntu