| 1 | = Alert rules- Practicals = |
| 2 | |
| 3 | 1. Verify whether '''pc1''' is '''down''' or '''up''' |
| 4 | 2. Check whether '''pc6 memory usage > 50%''' |
| 5 | 3. Find the devices where the '''CPU usage >=90''' |
| 6 | |
| 7 | >Note : Configure to send email in above scenarios |
| 8 | |
| 9 | == Answers == |
| 10 | |
| 11 | 1. |
| 12 | {{{#!sql |
| 13 | SELECT * FROM devices WHERE (devices.device_id = ?) AND (devices.disabled = 0 && devices.ignore = 0) = 1 AND devices.status = 1 |
| 14 | }}} |
| 15 | [[Image(Alert1.png,85%,border=1, center)]] |
| 16 | 2. |
| 17 | {{{#!sql |
| 18 | SELECT * FROM devices,mempools WHERE (devices.device_id = ? AND devices.device_id = mempools.device_id) AND (devices.status = 1 |
| 19 | && (devices.disabled = 0 && devices.ignore = 0)) = 1 AND mempools.mempool_perc >= 90 AND mempools.mempool_descr REGEXP "Virtual.*" |
| 20 | }}} |
| 21 | [[Image(Alert2.png,85%,border=1, center)]] |
| 22 | 3. |
| 23 | {{{#!sql |
| 24 | SELECT * FROM devices,processors WHERE (devices.device_id = ? AND devices.device_id = processors.device_id) AND |
| 25 | (devices.status = 1 && (devices.disabled = 0 && devices.ignore = 0)) = 1 AND processors.processor_usage >= 90 |
| 26 | }}} |
| 27 | [[Image(Alert3.png,85%,border=1, center)]] |