Push GPS coordinates to PMP450SMs?

Hello,

Is there a way to push The GPS coordinates from cnMaestro to the PMP450 SMs.  For instance we have all our clients geo-located in Powercode and we can export that data, is there a way to get cnmaestro to push that data out to the SMs so that they show up on the maps??

-Sean

Yes.  You can navigate to individual devices in the left-hand tree while in the configuration context (Configure -> Configure Devices).  There will be fields for entering Latitude and Longitude GPS coordinate.  Once you click save after changing them, they will be automatically pushed to the SM as a configuration update.  This configuration push is applicable for ePMP and PMP devices.

yes i realize i can do this individually but that's not practical for thousands of devices.

is there a way to automate a push of the data via cnmaestro (or SNMP if necessary) to populate the GPS data for thousdands of SMs?

thanks,

sean

This currently cannot be done programmatically.   We will release a RESTful API in Q2 for cnMaestro On-Premises that will initially focus on monitoring, but will expand over time.  This should eventually incorporate the API that is used to set individual device latitude/longitude.

I recommend using a script to push SNMP values in the short term since you have all the values available in an export file.  The relevant OIDs should be available in the PMP450 MIB file.

Relevant OIDs for PMP and ePMP device shown below.

OIDs for PMP devices

OIDs for ePMP devices

2 Likes

Any update to this what is available to be done via cnMaestro?

1 Like

Hi lmcginnis,

Yes, the RESTful API is now available for cnMaestro On-Premises. The user guide can be found on Support Center and full Swagger documentation can be found in cnMaestro itself via Services > API Clients.

You’ll need to create an API client on that page first before using the API. Once a client is added to the table there will be a Try It Out link to the Swagger page that provides full documentation and the ability to test out APIs.

You will be interested in the PUT /devices/{mac} API. It allows setting values for latitude and longitude that will be set within cnMaestro and also pushed to devices as a configuration update.

I get a 400 back when trying to update the latitude and longitude:

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): 10.10.10.10:443
send: b’PUT /api/v1/devices/0A:00:3E:EE:CD:EA HTTP/1.1\r\nHost: 10.10.10.10\r\nUser-Agent: python-requests/2.24.0\r\nAccept-Encoding: gzip, deflate\r\naccept: application/json\r\nConnection: keep-alive\r\ncontent-type: application/x-www-form-urlencoded\r\nAuthorization: Bearer 27c4f9dd22f9d1fd255a94499df101e8cb4ca6\r\nContent-Length: 37\r\n\r\n’
send: b’latitude=34.92485&longitude=-90.17976
reply: ‘HTTP/1.1 400 Bad Request\r\n’
header: Server: nginx
header: Date: Fri, 20 Nov 2020 21:10:31 GMT
header: Content-Type: application/json; charset=utf-8
header: Content-Length: 77
header: Connection: keep-alive
header: Vary: Accept-Encoding
header: Strict-Transport-Security: max-age=31536000; includeSubDomains
DEBUG:urllib3.connectionpool:https://10.10.10.10:443 “PUT /api/v1/devices/0A:00:3E:EE:CD:EA HTTP/1.1” 400 77
b’{“error”:{“cause”:“InvalidInputError”,“message”:“latitude should be number”}}’

I’m clearly sending a number, a float in fact, not that it should matter because everything I am sending is interpreted first as a string by nginx. Is there some other way to format this? Updating the device description using this method works, but not the coordinates.

Have you tried sending the data as application/json rather than application/x-www-form-urlencoded?