I don’t seem to have any good examples of it, but fundamentally these widgets are created by the same functions that create the /eventlog/ /syslog/ /alerts/ and /alertlog/ pages, so can accept the same arguments as those pages can.

Like, you can limit to a list of devices with device_id, or a group, or a status.

The easy way to do it is to make a search on the page using the form with the arguments you want, then copy what it’s built in the URL into the json array, that way you get the field names correct.

The only example I have set up is for the eventlog, but the same basic thing works for them all:

image0.png


Sent from my iPhone

On 2 Oct 2024, at 22:51, Adam Armstrong <adama@observium.org> wrote:

What made you think the alert widget will understand any of that?

😵‍💫


Sent from my iPhone

On 2 Oct 2024, at 14:44, Jose Napoli via observium <observium@lists.observium.org> wrote:

Hi Adam,

Can you tell me if this is Ok?


l> SELECT * FROM dash_widgets;
+-----------+---------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+------+-------+--------+
| widget_id | dash_id | widget_type      | widget_config                                                                                                                                                                                                                                                                         | x    | y    | width | height |
+-----------+---------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+------+-------+--------+
|         2 |       1 | status_summary   | {}                                                                                                                                                                                                                                                                                    |    0 |    0 |    12 |      8 |
|         3 |       1 | map              | {}                                                                                                                                                                                                                                                                                    |    0 |    8 |    12 |      8 |
|         4 |       1 | old_status_boxes | {}                                                                                                                                                                                                                                                                                    |    0 |   16 |    12 |      3 |
|         5 |       1 | old_status_table | {}                                                                                                                                                                                                                                                                                    |    0 |   19 |    12 |      8 |
|         6 |       1 | eventlog         | {}                                                                                                                                                                                                                                                                                    |    0 |   27 |    12 |      8 |
|        32 |       5 | status_summary   | []                                                                                                                                                                                                                                                                                    |    7 |   18 |     5 |      3 |
|        33 |       5 | old_status_table | []                                                                                                                                                                                                                                                                                    |    0 |    0 |    12 |     18 |
|        34 |       5 | old_status_boxes | []                                                                                                                                                                                                                                                                                    |    0 |   24 |    12 |     10 |
|        54 |       5 | alertlog         | []                                                                                                                                                                                                                                                                                    |    0 |   18 |     7 |      6 |
|        66 |       1 | alert_table      | []                                                                                                                                                                                                                                                                                    |    0 |   35 |     4 |      3 |
|        67 |       1 | alert_boxes      | []                                                                                                                                                                                                                                                                                    |    4 |   35 |     4 |      3 |
|        87 |      10 | alert_boxes      | []                                                                                                                                                                                                                                                                                    |    5 |    0 |     6 |     14 |
|        92 |      10 | status_summary   | []                                                                                                                                                                                                                                                                                    |    1 |   13 |     4 |      3 |
|        93 |      10 | alert_table      | []                                                                                                                                                                                                                                                                                    |    0 |    0 |     5 |     13 |
|        94 |      10 | old_status_table | []                                                                                                                                                                                                                                                                                    |    5 |   14 |     5 |      7 |
|       107 |      10 | alert_table      | []                                                                                                                                                                                                                                                                                    |    0 |   16 |     4 |      3 |
|       109 |      14 | alert_table      | []                                                                                                                                                                                                                                                                                    |    0 |    0 |     5 |      7 |
|       119 |      15 | alert_boxes      | {
   "conditions": [
       {"metric": "processor_usage", "comparison": "ge", "value": 90, "message": "CPU usage exceeded 90%"},
       {"metric": "mempool_perc", "comparison": "greater", "value": 90, "message": "Memory usage exceeded 90%"}
   ],
   "status": "critical"
} |    0 |    0 |     8 |     17 |
+-----------+---------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+------+-------+--------+
18 rows in set (0,00 sec)


Because I keep seeing that the widget of dash 15 keeps showing other alerts instead of the ones I injected in the conditions
_______________________________________________
observium mailing list -- observium@lists.observium.org
To unsubscribe send an email to observium-leave@lists.observium.org