phpIPAM to Homepage

Published by Christian Mohn · Read in about 3 min (452 words)

I recently set up Homepage which offers an application/service dashboard for my resources. For a small home lab this works well, and it is very handy to have an easy to access dashboard like this available. It offers integration and widgets for a whole slew of services like Plex, Uptime Kuma and Synology. It even has native icmp based monitoring built in. All in all, it’s pretty slick!

Homepage is fairly easy to set up, and configure, but it requires editing of .yaml files which it uses to render the dashboard. For small environments, like my home network, that’s not really a problem, but for larger, shared, environments maintaining these .yaml files manually gets messy over time.

My shared work lab is one of these environments — but I still wanted to see if we could use Homepage as a dynamically updated, simple dashboard for the available services in that environment. Luckily we use phpIPAM for IP address management and discovery, and it has an API we can use.

Enter phpIPAM to Homepage #

Note

Of course, this is designed for our specific use case, but in case someone else is looking to automate Homepage .yaml file generation, this could be a good starting point.

phpIPAM to Homepage is a PowerShell script that does the following:

  1. Connect to the phpIPAM API
  2. Grab all valid hostnames from all subnets
  3. Iterate through all the hostnames, and scan them with nmap
  4. Create a services.yaml file for Homepage for all hosts that respond on any of the following ports: 22 (ssh) | 80 (http) | 443 (https) | 3389 (rdp). If a given host responds to more than one of these ports, add an entry for each port with a corresponding URI scheme link.
  5. The services.yaml file includes specific icons for each of the services discovered, as well as naming convention that also indicates which port has been discovered (e.g. hostname:port)

Info

It does, at least not currently, create any fancy Homepage dashboards. All it does is create a very simple list of hosts with links to them.

Sample services.yaml output #

- Discovered Hosts:
  - hostname1.example.com:22:
      href: ssh://hostname1.example.com
      icon: mdi-ssh
  - hostname2.example.com:443:
      href: https://hostname2.example.com
      icon: mdi-web
  - hostname2.example.com:80:
      href: http://hostname2.example.com
      icon: mdi-web
  - hostname3.example.com:3389:
      href: rdp://hostname3.example.com
      icon: mdi-remote-desktop

Screenshot #

Example Homepage Dashboard

It can be run standalone as a PowerShell script, or as we use it in our lab environment as a single purpose container that runs, creates the .yaml file and exits as soon as it’s done. This way we can schedule the container to run when we want it to, and it doesn’t take up any resources when it’s not active.

For installation, configuration, and a ready to use Alpine Linux container, check phpIPAMtoHomepage on GitHub.

Post last updated on January 24, 2025: Fix formatting in phpIPAM-to-Homepage description for improved readability

About

vNinja.net is the online hub of Christian Mohn and Stine Elise Larsen.

The site primarily focuses on IT architecture and data center technologies, with a strong emphasis on virtualization and related topics.
While the main content revolves around these areas, you'll also find a range of other subjects covered from time to time, reflecting the interests of authors.

Sponsors