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



  • 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>



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



  • 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.



  • 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.



  • 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?


Log in to reply