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

    SNMP OID for Captive Portal user count

    Scheduled Pinned Locked Moved Captive Portal
    7 Posts 5 Posters 3.1k 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.
    • R
      rovshango
      last edited by

      Dear Friends,

      Does anyone know how to get count of logged users in CP, surely I can see it from status page and RRD graphs.
      But I wanna find SNMP OID, so I can create custom graphs in Zabbix as example.

      Thank you all in advance.

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        There is no SNMP OID for captive portal, it's not exposed to the snmp daemon in any usable way.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • Y
          yanqian
          last edited by

          Hi,rovshango
          You can do it in another way, use "UserParameter" method of zabbix.

          please check this post for detail.

          https://forum.pfsense.org/index.php?topic=70766.msg386632#msg386632

          1, Install zabbix agent in package manager, then configure zabbix agent settings in web GUI as you need;
          2, create a script, for example /root/CP_total_users, then add "UserParameter" line in /usr/local/etc/zabbix22/zabbix_agentd.conf

          UserParameter=CP_users,/root/CP_total_users
          

          3, Create a host in zabbix Web UI for this pfsense box, add the item of custom key "CP_users" in this host;

          4, Create graph as you need, Done!

          1 Reply Last reply Reply Quote 0
          • Y
            yanqian
            last edited by

            Here is a question about pfsense or zabbix agent.

            I am using zabbix to monitor the Captive Portal user count, and the zabbix agent is running by the user "zabbix", I also create the script following @Gertjan 's post. There is a step that I forgot to mention in the last post. I need to change the file permission of "/usr/local/etc/php/extensions.ini" , let zabbix user can read it, otherwise the script will not work when zabbix agent execute it.

            chmod a+r /usr/local/etc/php/extensions.ini
            

            but when I reboot pfsense, the file permission restore to default ( -rw–----- ).

            how can I keep the change persistent after reboot ?

            I will not change the run user of zabbix agent (to root) unless I have to, also I want to know if I modify the zabbix file (/usr/local/etc/rc.d/zabbix_agentd_lts.sh), will it restore to default after reboot too?

            1 Reply Last reply Reply Quote 0
            • GertjanG
              Gertjan
              last edited by

              @yanqian:

              I will not change the run user of zabbix agent (to root) unless I have to, also I want to know if I modify the zabbix file (/usr/local/etc/rc.d/zabbix_agentd_lts.sh), will it restore to default after reboot too?

              No.
              The file "/usr/local/etc/rc.d/zabbix_agentd_lts.sh" is part of the package.
              Edit it to add some code to change your file permissions.
              Of course, reinstalling the package will change the file.
              NOT pfSEnse reboot.

              No "help me" PM's please. Use the forum, the community will thank you.
              Edit : and where are the logs ??

              1 Reply Last reply Reply Quote 0
              • Y
                yanqian
                last edited by

                Thank you, but I found the first tree lines of the file "/usr/local/etc/rc.d/zabbix_agentd_lts.sh", so it is not suitable for adding custom commands.

                #!/bin/sh

                This file was automatically generated

                by the pfSense service handler.

                I also tried to modify it, and it restored to original state after reboot.
                Now I will follow this doc Executing commands at boot time, will update here after I finish test.

                update:
                OK, The "shellcmd option" works well.

                1 Reply Last reply Reply Quote 0
                • J
                  jgshier
                  last edited by

                  Did you get this fixed? I am running into the same issue.

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