2022-04-26 02:37:39 -05:00
|
|
|
# Rules
|
2017-10-02 21:36:22 +01:00
|
|
|
|
2019-06-20 13:53:45 -05:00
|
|
|
The simplest way of testing if an alert rule will match a device is by
|
|
|
|
going to the device, clicking edit (the cog), select Capture. From
|
|
|
|
this new screen choose Alerts and click run.
|
2017-10-02 21:36:22 +01:00
|
|
|
|
2019-06-20 13:53:45 -05:00
|
|
|
The output will cycle through all alerts applicable to this device and
|
|
|
|
show you the Rule name, rule, MySQL query and if the rule matches.
|
2017-10-02 21:36:22 +01:00
|
|
|
|
2017-11-08 16:27:23 -06:00
|
|
|
See [Device Troubleshooting](../Support/Device-Troubleshooting.md)
|
2017-11-08 14:11:58 -06:00
|
|
|
|
2017-10-02 21:36:22 +01:00
|
|
|
---
|
|
|
|
|
2022-04-26 02:37:39 -05:00
|
|
|
## Transports
|
2017-10-02 21:36:22 +01:00
|
|
|
|
2019-06-20 13:53:45 -05:00
|
|
|
You can test your transports by forcing an actual active alert to run
|
|
|
|
regardless of the interval or delay values.
|
2017-10-02 21:36:22 +01:00
|
|
|
|
2019-06-20 13:53:45 -05:00
|
|
|
`./scripts/test-alert.php`. This script accepts -r for the rule id, -h
|
|
|
|
for the device id or hostname and -d for debug.
|
2017-10-02 21:36:22 +01:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2022-04-26 02:37:39 -05:00
|
|
|
## Templates
|
2017-10-02 21:36:22 +01:00
|
|
|
|
2019-06-20 13:53:45 -05:00
|
|
|
It's possible to test your new template before assigning it to a
|
|
|
|
rule. To do so you can run `./scripts/test-template.php`. The script
|
|
|
|
will provide the help info when ran without any parameters.
|
2017-10-02 21:36:22 +01:00
|
|
|
|
2019-06-20 13:53:45 -05:00
|
|
|
As an example, if you wanted to test template ID 10 against localhost
|
|
|
|
running rule ID 2 then you would run:
|
2017-10-02 21:36:22 +01:00
|
|
|
|
|
|
|
`./scripts/test-template.php -t 10 -d -h localhost -r 2`
|
|
|
|
|
2019-06-20 13:53:45 -05:00
|
|
|
If the rule is currently alerting for localhost then you will get the
|
|
|
|
full template as expected to see on email, if it's not then you will
|
|
|
|
just see the template without any fault information.
|