28. 03. 2026 Alessandro Paoli Asset Management, GLPI

Taking Inventory of Cisco Phones in GLPI with curl and glpi-injector

In recent days I came across an interesting case: inventorying a fleet of Cisco phones… without SNMP. The devices only exposed a web UI, so no classic polling was possible.

The solution was simple: query the phones’ HTTP pages, extract useful information, and send it to GLPI.

The Idea

The approach is intentionally minimal:

  • Maintain a list of phone IPs
  • Query the web UI via HTTP
  • Parse the main information
  • Build a payload
  • Send it to GLPI using glpi-injector

No agent, no SNMP, just HTTP.

The key point: Parsing the web UI

This is where all the complexity lies. Cisco phones don’t expose data in a uniform way:

  • Different endpoints
  • XML, HTML, or pseudo-XML
  • Non-standard field names

For this reason:

  • The script is generic
  • Parsing must be adapted to the actual model

The correct method is always the same:

  1. Query a phone with curl
  2. Save the response
  3. Analyze the content
  4. Identify useful fields

Example:

curl http://IP_PHONE/ -o output.html

Extracting data (parsing)

If the phone exposes XML, you can use xmllint:

xmllint --xpath "string(//*[local-name()='HostName'][1])" output.xml
xmllint --xpath "string(//*[local-name()='SerialNumber'][1])" output.xml

If it’s HTML, you can use grep/sed:

grep -oP 'Host Name:</td><td>\K[^<]+' output.html
grep -oP 'MAC Address:</td><td>\K[^<]+' output.html

This is the part that really needs customization. Each Cisco model may require different regex or tags.

Script Flow

The full script can be long, but the flow is actually very simple:

1. Fetch HTTP page

curl -fsS -u "$USER:$PASS" "http://$IP/admin/spacfg.xml" -o "$RAW"

2. Parse main fields

HOSTNAME=$(xmllint --xpath "string(//*[local-name()='HostName'][1])" "$RAW")
SERIAL=$(xmllint --xpath "string(//*[local-name()='SerialNumber'][1])" "$RAW")
MAC=$(xmllint --xpath "string(//*[local-name()='MACAddress'][1])" "$RAW")
MODEL=$(xmllint --xpath "string(//*[local-name()='ModelNumber'][1])" "$RAW")

3. Create JSON payload

cat > "$JSON" <<EOF
{
  "deviceid": "$HOSTNAME",
  "content": {
    "itemtype": "Phone",
    "name": "$HOSTNAME",
    "serial": "$SERIAL",
    "models": [{ "name": "$MODEL" }],
    "networks": [{
      "ips": [{ "ip": "$IP" }],
      "mac": "$MAC"
    }]
  }
}
EOF

4. Send to GLPI

glpi-injector --file "$JSON" --url "$GLPI_URL"

What really needs to be adapted

There’s only one critical part: parsing. It’s always best to:

  • Test on a single phone
  • Save the HTTP response
  • Identify the actual fields
  • Adapt XPath or regex
  • Verify that hostname, serial, and MAC are always present

Advantages

  • No agent required
  • No SNMP
  • Leverages already exposed data
  • Simple integration with GLPI
  • Easily schedulable (cron)
  • Useful for “difficult” VoIP environments

Limitations

  • Cisco models are not uniform
  • Web UI must be accessible
  • Possible authentication required
  • Fragile HTML parsing
  • Error handling is essential

Practical advice

Don’t start too big. It’s better to begin with:

  • 1 phone model
  • 1 minimal script
  • A few IPs
  • Testing on a lab GLPI

Then scale up.

Conclusion

Inventorying Cisco phones without SNMP is absolutely possible. The combination:
curl + HTTP or XML parsing + glpi-injector
is a simple, lightweight, and surprisingly effective solution.

The truly important part is not sending data to GLPI, but the ability to:

  • Correctly read the web UI
  • Build reliable parsing

Once that’s done, the rest is just plumbing.

These Solutions are Engineered by Humans

Did you find this article interesting? Does it match your skill set? Our customers often present us with problems that need customized solutions. In fact, we’re currently hiring for roles just like this and others here at Würth IT Italy.

Alessandro Paoli

Alessandro Paoli

My name is Alessandro Paoli and I've been a Technical Consultant at Wurth IT Italy since May 2024. I've always had a great passion for IT and since 2004 it has also become my job. In 2015 I found my role in the field, monitoring. I have had the opportunity to use various monitoring products, both open source and proprietary, I have worked on numerous projects from small businesses to global companies. I am married and have 2 wonderful daughters. My passions are travel, cinema, games (video and board) and comics, and every now and then I manage to indulge in a few days of sport (Padel and gym).

Author

Alessandro Paoli

My name is Alessandro Paoli and I've been a Technical Consultant at Wurth IT Italy since May 2024. I've always had a great passion for IT and since 2004 it has also become my job. In 2015 I found my role in the field, monitoring. I have had the opportunity to use various monitoring products, both open source and proprietary, I have worked on numerous projects from small businesses to global companies. I am married and have 2 wonderful daughters. My passions are travel, cinema, games (video and board) and comics, and every now and then I manage to indulge in a few days of sport (Padel and gym).

Leave a Reply

Your email address will not be published. Required fields are marked *

Archive