This sample script adds hosts from a CSV file using the REST API in OP5 Monitor. This is provided on a "Proof of concept" level, so test before use. Also, see an example input file on how the CSV file should be formatted.
Usage:
[agalorio@pugo ~]$ chmod 777 add_hosts_api.sh
[agalorio@pugo ~]$ ./add_hosts_api.sh hosts.csv
[DONE] Host: server1 Added
[DONE] PING Added on server1
[DONE] Host: server2 Added
[DONE] PING Added on server2
[DONE] Host: server3 Added
[DONE] PING Added on server3
[DONE] Host: server4 Added
[DONE] PING Added on server4
[DONE] Host: server5 Added
[DONE] PING Added on server5
[DONE] Host: server6 Added
[DONE] PING Added on server6
[DONE] Host: server7 Added
[DONE] PING Added on server7
[DONE] Host: server8 Added
[DONE] PING Added on server8
Do you want to save current configuration? (y/n)y
Saving configuration ......
"Changes saved"
[agalorio@pugo ~]$
Comments
0 comments
Please sign in to leave a comment.