Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Realtime bandwidth monitoring with Nagios

    Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
    1 Posts 1 Posters 1.8k Views
    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.
    • E
      eroji
      last edited by

      I wrote these little scripts for monitoring my realtime DL/UL pfsense bandwidth for Nagios and graph them. It can be done with a single script using bash but I decided to use it as an opportunity to brush up my Python. The Python script purely outputs the Mbit/s only and the bash script handles text output and exit codes and Nagios perfdata for graphing. There seems to be a problem with the SNMP octet readout occasionally which causes the speed calculation to yield a negative number, so I made the bash script to output UNKNOWN in those cases so the graph does not get jacked up.

      You will need to edit the bash script slightly to identify the location of Python binary, location of Python script and your max bandwidth.

      Examples:
      ./pfsense_bandwidth <hostname>public ifInOctets. <interface number="">./pfsense_bandwidth.py -H <hostname>-C public -I ifInOctets. <interface.number>pfsense_bandwidth.zip</interface.number></hostname></interface></hostname>

      1 Reply Last reply
      Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post
      Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
      Privacy Policy · Cookie Policy