Zabbix HTTP Agent LLD Rule Example

UPDATE: The DPM part of this whole ordeal was invalidated by the recent addition of event publishing for DPM. If you can, get the update and just setup windows event monitors for backup actions.

Jump to Zabbix Item Examples

TL;DR: Built an asp.net API to query a DPM view and spit out JSON that Zabbix could handle for both discovery and data. Put this here because there weren’t many resources on the whole HTTP LLD deal.

Rough Draft, I built this whole project in about 5 hours, sue me. I imagine you’re here for the Zabbix HTTP Agent LLD stuff so I left the API part out. If you want the whole shebang (API, Code, Setup) let me know with a comment. I don’t want to a whole project if it’s just going to rot in my little corner of the internet.

We’ve been using DPM for our backups only to be thwarted in our monitoring attempts. We could have used Operations Manager but the problem was that we weren’t using OM for anything else. The only thing worse than an incomplete dashboard is two incomplete dashboards. So I bit the bullet and now we can finally monitor DPM with Zabbix.

DPM’s built in reporting was a royal pain and took too much manual review time. The email alerts were pretty much all or nothing and I’m loathe to contribute to alert blindness so I hammered this… thing… out.

I built a quick web API with two controllers, one to provide discovery data, and another for the details. The discovery URL (/api/DpmDiscovery/{HOST.NAME}) would hand back the LLD formatted JSON and the other URL (/api/DpmStatus/{#RECPOINT.BACKUPPATH}) would spit out details.

A call for https://dpmapi.contoso.ca/api/DpmDiscovery/file01 would return the following json.

{
    "data": [
        {
            "{#RECPOINT.STATUS}": 2,
            "{#RECPOINT.IDSN}": "D:\\",
            "{#RECPOINT.SERVERNAME}": "file01.contoso.ca",
            "{#RECPOINT.BACKUPPATH}": "file01.contoso.ca..D:..",
            "{#RECPOINT.CREATIONTIME}": "2019-04-25T00:05:28-06:00",
            "{#RECPOINT.UNIXTIME}": "1556172328"
        },
        {
            "{#RECPOINT.STATUS}": 2,
            "{#RECPOINT.IDSN}": "E:\\",
            "{#RECPOINT.SERVERNAME}": "file01.contoso.ca",
            "{#RECPOINT.BACKUPPATH}": "file01.contoso.ca..E:..",
            "{#RECPOINT.CREATIONTIME}": "2019-04-25T00:05:42-06:00",
            "{#RECPOINT.UNIXTIME}": "1556172342"
        },
        {
            "{#RECPOINT.STATUS}": 2,
            "{#RECPOINT.IDSN}": "System State",
            "{#RECPOINT.SERVERNAME}": "file01.contoso.ca",
            "{#RECPOINT.BACKUPPATH}": "file01.contoso.ca..System_State",
            "{#RECPOINT.CREATIONTIME}": "2019-04-25T02:10:59-06:00",
            "{#RECPOINT.UNIXTIME}": "1556179859"
        }
    ]
}

Then the LLD rule creates an HTTP Agent item to call https://dpmapi.contoso.ca/api/DpmStatus/file01.contoso.ca..System_State

{
    "status": 2,
    "interpretedDsn": "System State",
    "serverName": "file01.fireball.ads",
    "backupPath": "file01.fireball.ads..System_State",
    "creationTime": "2019-04-25T02:10:59-06:00",
    "unixCreationTime": "1556179859"
}

Technically my API returned the data as application/json; however I had accidentally checked “Convert To JSON” so you’ll see a body element in the JSON path below (e.g. $.body.status). In theory I could uncheck that and remove the body element. In practice it works as-is so it’ll stay that way for now.

Example Screenshots

Zabbix Discovery Rule

Zabbix Data Item

Dependent Item



These dependent items use JSON Path processing to extract the actual data out of my details response.

(body element was inserted because I had checked “Convert to JSON”)

Citations Nonsense:
DPM SQL View Documentation: https://docs.microsoft.com/en-us/previous-versions/system-center/data-protection-manager-2010/ff399120(v=technet.10)
Handy JSON validator: https://jsonformatter.curiousconcept.com/
Go-To JSON Browser: http://jsonviewer.stack.hu/