| 93 | There exist two types of queries: |
| 94 | |
| 95 | Alert Queries: are used to send remote alerts to remote Nagios [https://www.nagios.org/documentation] hosts. These queries require 5 explicitly defined values to be emitted by the query including, "nagiosserver", "hostname", "servicename", alertlevel, and "alertmessage". The function used to generate the payload sent to your Nagios server is shown below: |
| 96 | |
| 97 | {{{ |
| 98 | public void alert(String hostName, String serviceName, String alertLevel, String alertMessage) |
| 99 | { |
| 100 | MessagePayload payload = new MessagePayloadBuilder() |
| 101 | .withHostname(hostName) |
| 102 | .withLevel(Level.valueOf(alertLevel)) |
| 103 | //.withServiceName("Service Name") |
| 104 | .withServiceName(serviceName) |
| 105 | .withMessage(alertMessage) |
| 106 | .create(); |
| 107 | ... |
| 108 | }}} |
| 109 | |
| 110 | The following queries are examples of Alert Queries: |