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

Changing network interface names at FreeBSD level…or? (Zabbix)

Scheduled Pinned Locked Moved General pfSense Questions
5 Posts 2 Posters 3.2k 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.
  • S
    skorpioskorpio
    last edited by Jun 14, 2016, 7:57 PM Jun 13, 2016, 9:59 PM

    I want to change the network interface names at the OS level so that when I grab statistics for monitoring they are named something meaningful, specifically Zabbix monitoring. I have several multiport NICs in the pfSense box and Zabbix discoveries will simply name them whatever the "em" devices are and have no relation to the "WAN, LAN, OPT" names pfSense uses.

    Renaming network interfaces in a regular FreeBSD box is easy enough, just put "ifconfig_em<whatever>_name=<whatever>" into /etc/rc.conf, but if I do that on a pfSense box it throws the box into setup mode on boot.

    Doing this manually once the box is up with "ifconfig em? name wan" works fine, you just need to go into the interface assignment in the gui and switch to the new name and kind of duplicate the anti-lockout rule on another interface so you can rename the one that carries the WebConfigurator.

    So I guess the question is where would one put the renaming so that it gets assigned as soon after the interfaces are up so that pfSense just does it's thing with the reassigned names?</whatever></whatever>

    1 Reply Last reply Reply Quote 0
    • S
      skorpioskorpio
      last edited by Jun 14, 2016, 8:27 PM Jun 14, 2016, 6:32 PM

      Huh, I didn't think it was that tricky of a question.  :-\

      1 Reply Last reply Reply Quote 0
      • C
        cmb
        last edited by Jun 14, 2016, 7:02 PM

        No supported means of doing that. Anything you hack in would be problematic in the future as it'd end up overwritten by upgrades. Interfaces don't change around much, best off updating your monitoring as needed on the rare occasion they change.

        1 Reply Last reply Reply Quote 0
        • S
          skorpioskorpio
          last edited by Jun 14, 2016, 8:27 PM Jun 14, 2016, 7:55 PM

          hmm, ok then let's rephrase, where then, from a shell level, is the mapping of pfSense interface names to FreeBSD names? So that I could rewrite the network interface discovery routine that the Zabbix agent reports back to the server?

          Also, I guess, if surviving upgrades is a problem, I have to ask, does pfSense then wipe out the underlying OS when it upgrades and just apply a saved configuration to basically a new install? …and if so does that mean that any installed packages are then reinstalled on the new instance?

          The Zabbix agent is a menu installable package in pfS and as such should report interfaces as something meaningful and not as some arbitrary name someone never sees again after the box is setup. There are only 2 elegant solutions for this, one is that the names of the interfaces change on the pfSense box to reflect what is displayed by Rules and Services in the UI (what my original question suggested) or the installed Zabbix Agent is aware of these name mappings and reports those back to the Zabbix server. A templated discovery in Zabbix is not something that can be renamed on the monitoring server, it simply titles things based on what the agent tells it the device is. Kinda hacky for something that made the short list of packages installable through the GUI, just MHO, unless I am missing something and there is a secret template specifically for pfSense on Zabbix somewhere, if there is it should be referred to at the end of a successful install of the Agent.

          Not trying to get all bitchy, it just seems that if you are going to try and orchestrate an arranged marriage between these two they should at least know each others names.

          1 Reply Last reply Reply Quote 0
          • S
            skorpioskorpio
            last edited by Jun 14, 2016, 8:26 PM

            Given that there is no "UserParameter=" tags in the installed zabbix_agentd.conf I have to assume there would be no magic template to do this unless the agent has been specifically compiled with added sources to accomplish something above and beyond what the standard FreeBSD agent provides, meaning that there probably isn't anything discoverable beyond the regular "Template OS FreeBSD" that comes with a Zabbix Server install.

            So then, the other question would be, does the zabbix_agentd.conf file or more importantly, I guess, the entire /usr/local/etc/zabbix22 directory survive a significant version upgrade?

            1 Reply Last reply Reply Quote 0
            5 out of 5
            • First post
              5/5
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
              This community forum collects and processes your personal information.
              consent.not_received