File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -204,6 +204,101 @@ You can access the custom field data for the clients data query like this:
204204Note that you can't use dot notation for a property if it has spaces. See the above
205205example for the **Custom Field 2** property
206206
207+ # ## properties - array of strings
208+
209+ This will allow injecting model @property fields into the data. The current supported
210+ fields are :
211+
212+ **Agent**
213+
214+ * client
215+ * timezone
216+ * is_posix
217+ * arch
218+ * status
219+ * checks
220+ * pending_actions_count
221+ * cpu_model
222+ * graphics
223+ * local_ips
224+ * make_model
225+ * physical_disks
226+ * serial_number
227+
228+ **AgentCustomField**
229+
230+ * value
231+
232+ **Alert**
233+
234+ * assigned_agent
235+ * site
236+ * client
237+ * get_result
238+
239+ **Policy**
240+
241+ * is_default_server_policy
242+ * is_default_workstation_policy
243+
244+ Automated Task
245+
246+ * schedule
247+
248+ **Check**
249+
250+ * readable_desc
251+
252+ **CheckResult**
253+
254+ * history_info
255+
256+ **Client**
257+
258+ * live_agent_count
259+
260+ **Site**
261+
262+ * live_agent_count
263+
264+ **Client Custom Field**
265+
266+ * value
267+
268+ **Site Custom Field**
269+
270+ * value
271+
272+ We can pull this data in a data query like this :
273+
274+ ` ` ` yaml
275+ data_sources:
276+ agents:
277+ model: agent
278+ only:
279+ - hostname
280+ - operating_system
281+ - plat
282+ properties:
283+ - status
284+ - is_posix
285+ - make_model
286+ - cpu_model
287+ checks:
288+ model: check
289+ properties:
290+ - readable_desc
291+ ` ` `
292+
293+ You can access the property data directly on the agent in the template like this :
294+
295+ ` ` `
296+ {% for item in data_source.agents %}
297+ {{ item.status }}
298+ {{ item.make_model }}
299+ {% endfor %}
300+ ` ` `
301+
207302# ## [filter](https://docs.djangoproject.com/en/4.2/ref/models/querysets/#filter) - object
208303
209304Using the filter property, you can filter the amount of rows that are returned. This
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ Tactical RMM allows passing dashboard data into script as arguments or environme
77
88For a full list of available fields, refer to the variables in the ` models.py ` files:
99
10+ !!!info
11+ @property functions under the model will work as well
12+
1013[ Agent] ( https://github.com/amidaware/tacticalrmm/blob/89aceda65a1c54fea7b18250ca63614f091eac6e/api/tacticalrmm/agents/models.py#L60 )
1114
1215[ Client] ( https://github.com/amidaware/tacticalrmm/blob/89aceda65a1c54fea7b18250ca63614f091eac6e/api/tacticalrmm/clients/models.py#L18 )
You can’t perform that action at this time.
0 commit comments