Prerequisites
MSB must be installed and started and he user knows the IP address of the MSB API gateway service. Regarding how to install MSB, please go to MSB Test Environment Setup.
PostgreSQL(v9.5) must be installed and started. For the guidance on how to run a PostgreSQL, please refer to Offical Repository of PostgreSQL.
While setting up PostgreSQL, a database and a user named ‘holmes’ must be created. The corresponding password shuold be set to ‘holmespwd’. Otherwise, Holmes could not be started up successfully.
Installation Steps
As a DCAE Analytics Application
<<TO BE DONE>>
As an Independent Application
Installation
Log in to the ONAP docker repo:
sudo docker login -u docker -p docker nexus3.onap.org:10001
Start Holmes using the commands below:
# DB_IP - the IP address of Postgres. Do not specify the port. The default port(5432) is adopted. # MSB_IP - the IP address of the MSB API gateway service. # HOST_IP - the IP address of the host (not the docker daemon) on which the docker container is running. # If the 'TESTING' variable is set to '1', you're telling Holmes not to query the IP address of the Holmes containers from the DCAE config binding service but to get it directly from the environment variable 'HOST_IP'. sudo docker run --name holmes-rule-management -p 9101:9101 -d -e URL_JDBC=$DB_IP -e MSB_ADDR=$MSB_IP -e TESTING=1 -e HOST_IP=$HOST_IP nexus3.onap.org:10001/onap/holmes/rule-management sudo docker run --name holmes-engine-management -p 9102:9102 -d -e URL_JDBC=$DB_IP -e MSB_ADDR=$MSB_IP -e TESTING=1 -e HOST_IP=$HOST_IP nexus3.onap.org:10001/onap/holmes/engine-management
Call the health check API to check whether Holmes has been started up successfully.
# the rule management component curl http://$MSB_IP/api/holmes-ruel-mgmt/v1/healthcheck # the engine management component curl http://$MSB_IP/api/holmes-engine-mgmt/v1/healthcheck
If the component returns "true", it is spun up successfully. Otherwise you have to use the 'sudo docker ps' and 'sudo docker logs <container_name>' to check what happened during the service instantiation.
Configurations
When Holmes is run in the standalone mode, it has to be configured manually in order to perform the sub/pub actions on DMaaP.
Subscribing
curl -X PUT -H 'Content-Type: application/json' \ -d '{"name":"unauthenticated.SEC_FAULT_OUTPUT", "url":"http://$DMAAP_IP:$DMAAP_PORT/events/unauthenticated.SEC_FAULT_OUTPUT"}' \ http://$MSB_IP/api/holmes-engine-mgmt/v1/dmaap/sub
After setting the subscribing url, a timer task will be started using the default query interval (15s).
Publishing
curl -X PUT -H 'Content-Type: application/json' \ -d '{"name":"unauthenticated.SEC_FAULT_OUTPUT", "url":"http://$DMAAP_IP:$DMAAP_PORT/events/unauthenticated.DCAE_CL_OUTPUT"}' \ http://$MSB_IP/api/holmes-engine-mgmt/v1/dmaap/pub
Then you have to deploy the rule into Holmes.
curl -X PUT -H 'Content-Type: application/json' -d @holmesrule http://10.96.33.33/api/holmes-rule-mgmt/v1/rule
The rule is saved into a file named "holmesrule" and it attached here.
DMAAP message for alarm from EMS driver
["{\"VESversion\":\"v5\",\"event\":{\"commonEventHeader\":{\"sourceId\":\"VNF_194.15.13.138\",\"startEpochMicrosec\":1501518702,\"eventId\":\"1501489595451\",\"nfcNamingCode\":\"\",\"reportingEntityId\":\"0000ZTHX1\",\"internalHeaderFields\":{\"collectorTimeStamp\":\"Fri, 10 20 2017 01:49:27 GMT\"},\"eventType\":\"applicationVnf\",\"priority\":\"High\",\"version\":3,\"reportingEntityName\":\"0000ZTHX1\",\"sequence\":960,\"domain\":\"fault\",\"lastEpochMicrosec\":1501518702,\"eventName\":\"Slave MPU is offline\",\"sourceName\":\"VNF_194.15.13.138\",\"nfNamingCode\":\"\"},\"faultFields\":{\"eventSeverity\":\"CRITICAL\",\"alarmCondition\":\"The slave MPU board is offline or abnormal\",\"faultFieldsVersion\":2,\"eventCategory\":\"equipmentAlarm\",\"specificProblem\":\"The slave MPU board is offline or abnormal\",\"alarmInterfaceA\":\"VNF_194.15.13.138\",\"alarmAdditionalInformation\":[{\"name\":\"specificProblemID\",\"value\":\"315\"},{\"name\":\"objectUID\",\"value\":\"0000ZTHX1PGWGJI6V1\"},{\"name\":\"locationInfo\",\"value\":\"MPU_22_20_0\"},{\"name\":\"addInfo\",\"value\":\"Aid:17;AlarmCode:110010;AlarmReasonCode:110010;Remark:\\\"DeployUnit=22,Node=21,SubNode=0\\\";\"}],\"eventSourceType\":\"PgwFunction\",\"vfStatus\":\"Active\"}}}"]