![]() It adds more queries to the mix, and delays monitoring more, but if there’s no other choice, build one. Generally speaking, if you can not use a device identifier, you should not. For example, the Ubiquiti device identifier looks at the interface names on a device to try to determine what it is. To get identifiers out of the way, the only time you need a device identifier is if a vendor has multiple types of devices that all respond with the same response to a system.sysObjectID query (OID 1.3.6.1.2.1.1.2.0.) If they do, check out the existing device identifiers to see how they work.Įssentially, you’ll need to build a device identifier to use some other method of figuring out what the actual device is and then return the appropriate mapper based on your investigation. I mentioned at the start that we’d focus on mappers and identifiers. Let’s circle back to building a new device mapper. You almost certainly don’t want to mess with this either. Worker contains our custom code for the AmPHP worker.Web contains all the logic to expose the poller web interface.Tasks contain work that is run inside an AmPHP pool.For example, there’s a Formatter in here that formats data, and an SnmpClient that performs SNMP queries. Services are for classes that do stuff in the context of a particular process flow.For example, DeviceFactory takes the JSON data from Sonar and formats it into Device models, as well as figuring out which devices need to be polled via ICMP or SNMP. Pipelines contains classes that move data from one part of the system to another.It’s unlikely you’ll ever want to touch this. For example, we extend the AmPHP platform using a class in here. Overrides contains classes that override other third party package classes.Models contains all the data models for the poller, such as Device, which represents a specific device to be monitored, or MonitoringTemplate which represents a monitoring template defined in Sonar.Realistically, this could probably live in Services. For example, there is a SysInfo class in here that figures out the number of processors on a poller to determine how many workers there should be in a pool. Helpers contains classes that don’t really fit anywhere else.functions.php contains non-class based functions that can be used anywhere.Exceptions contains any custom exceptions used by the poller.We’re going to mainly focus on DeviceIdentifiers and DeviceMappers, but for reference, here’s whats in each folder if you want to explore or work on something more complex. All the code you’ll want to look at is in the src directory. Now let’s step through how to build a new mapper, and test it easily. Head over to our repository and fork the poller. Great! Here’s a walk through on how to get started.įirst, you’ll need a copy of the source code. So, you want to contribute a device mapper to the Sonar poller. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |