You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.5 KiB

7 years ago
7 years ago
  1. yum install -y opennms-helm
  2. systemctl enable grafana-server
  3. systemctl start grafana-server
  4. firewall-cmd --zone=public --permanent --add-port=3000/tcp
  5. sleep 10
  6. curl -v --basic -XPOST 'admin:admin@localhost:3001/api/plugins/opennms-helm-app/settings?enabled=true' -d ''
  7. curl 'http://admin:admin@localhost:3000/api/datasources' -X POST -H 'Content-Type:application/json;charset=UTF-8' --data-binary '{"name":"OpenNMS","type":"opennms","access":"proxy","url":"http://localhost:8980/opennms","isDefault":true,"basicAuth":true,"basicAuthUser":"admin","basicAuthPassword":"admin"}'
  8. curl -u admin:admin -XPOST "http://localhost:3000/api/plugins/opennms-helm-app/settings" -d "id=opennms-helm-app&enabled=true" 2>/dev/null
  9. cat <<EOF > data-performance.json
  10. {
  11. "name": "opennms-performance",
  12. "type": "opennms-helm-performance-datasource",
  13. "access": "proxy",
  14. "url": "http://localhost:8980/opennms",
  15. "basicAuth": true,
  16. "basicAuthUser": "admin",
  17. "basicAuthPassword": "admin"
  18. }
  19. EOF
  20. curl -u admin:admin -H 'Content-Type: application/json' -XPOST -d @data-performance.json http://localhost:3000/api/datasources
  21. rm data-performance.json
  22. cat <<EOF > data-fault.json
  23. {
  24. "name": "opennms-fault",
  25. "type": "opennms-helm-fault-datasource",
  26. "access": "proxy",
  27. "url": "http://localhost:8980/opennms",
  28. "basicAuth": true,
  29. "basicAuthUser": "admin",
  30. "basicAuthPassword": "admin"
  31. }
  32. EOF
  33. curl -u admin:admin -H 'Content-Type: application/json' -XPOST -d @data-fault.json http://localhost:3000/api/datasources
  34. rm data-fault.json