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

    What is the output from the ifstats.php script?

    Scheduled Pinned Locked Moved Development
    2 Posts 2 Posters 2.6k 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.
    • ?
      Guest
      last edited by

      I hope this is the right place to ask this, I thought the pfSense developers might be more likely to know the answer rather than the end users.

      What is the output from the ifstats.php?if=vr1 page?  It looks like this:

      1241027646.2629|2647893277|3194759664

      I assume they are some kind of counter?  Is an an incrementing value, like how much traffic has passed since last boot?  What are the 3 separate values?

      I'm thinking about writing a script on our monitoring server that pulls in this data ever second or two and logs it for charting.  I run pfsense embeded so I can't install any plugins to do long term graphing there.

      Is there a lot of overhead when calling this script?  If it just pulls some counters off the nic then I would assume not, but maybe its calculating these values somehow.

      Also if I call the script with ifstats.php?if=vr2, ifstats.php?if=vr3, etc. I keep getting values, at least in the first column.  But my hardware device only has 3 network ports.  What are these additional interfaces, are they virtual IPs?

      Thanks for any info.

      1 Reply Last reply Reply Quote 0
      • Z
        Zorac
        last edited by

        from the php code:

        echo "$timing|" . $ifinfo['inbytes'] . "|" . $ifinfo['outbytes'] . "\n";

        meaning 'time|inbytes|outbytes'

        if you pick an interface that doesnt exist, it gives you only the time.  try using 'wan' or 'lan' instead.

        you could use this every easily to write a monitoring program, or you could use snmp as well.

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