librenms/tests/data/linux_logsize-v1.json
Zane C. Bowers-Hadley 2618a99be5
Application Soft Delete (#15270)
* add the softdeletes migrations for applications

* add working migration file

* add deleted_at to db schema.yaml for applications

* update includes/html/forms/application-update.inc.php to work with softdeletes

* update includes/html/pages/device/edit/apps.inc.php for softdelete

* update includes/discovery/applications.inc.php to work with softdelete

* minor updates to application-update.inc.php for disabling

* style cleanup

* set discovered when running discovery

* update application tests to include deleted_at

* add deleted_at to a missed test

* a few more tweaks for opensips

* add a missing deleted_at for linux_suricata_extract-v1

* fix fillable for Application model

* massive cleanup of the application update widget thingy

* improve the code for discovery and using Laravel

* add a missing line to app/Models/Application

* add a missing include to app/Models/Application.php

* record includes for Application model

* remove apps from the applications table when a device is deleted

* revert to using upcert and where for discovery to fix CI

* make discovered fillable and set it when running discovery... convert back to firstOrNew

* clean up application discovery a bit and use observer

* style fix

* spelling fix... disablaed -> disabled

* rever removal to just use where

* cleanup app removal on delete

* add restored to ModuleModelObserver

* delete -> forcedelete fix

* apply the suggested changes

* use murrants other suggestion

* style fix
2023-09-06 16:34:39 -05:00

107 lines
4.0 KiB
JSON

{
"applications": {
"discovery": {
"applications": [
{
"app_type": "logsize",
"app_state": "UNKNOWN",
"discovered": 1,
"app_state_prev": null,
"app_status": "",
"app_instance": "",
"data": null,
"deleted_at": null
}
]
},
"poller": {
"applications": [
{
"app_type": "logsize",
"app_state": "OK",
"discovered": 1,
"app_state_prev": "UNKNOWN",
"app_status": "",
"app_instance": "",
"data": "{\"sets\":{\"var_log\":{\"files\":[\"daemon\",\"mount\",\"devd\",\"utx\",\"setuid\",\"maillog\",\"Xorg.0\",\"xferlog\",\"mail\",\"snmpd\",\"bsdisks\",\"userlog\",\"ppp\",\"cron\",\"messages\",\"xdm\",\"dmesg\",\"security\",\"debug\",\"auth\"],\"max_size\":212661,\"mean_size\":32019.9,\"median_size\":2273.5,\"mode_size\":\"62\",\"min_size\":0,\"size\":640398,\"log_sizes\":{\"mail\":212661,\"maillog\":164271,\"Xorg.0\":64927,\"setuid\":48325,\"daemon\":46208,\"bsdisks\":38084,\"dmesg\":30308,\"cron\":25531,\"snmpd\":3796,\"userlog\":3488,\"xdm\":1059,\"auth\":724,\"mount\":371,\"messages\":331,\"xferlog\":64,\"ppp\":64,\"devd\":62,\"security\":62,\"debug\":62,\"utx\":0}}},\"no_minus_d\":null}",
"deleted_at": null
}
],
"application_metrics": [
{
"metric": "max_size",
"value": 640398,
"value_prev": null,
"app_type": "logsize"
},
{
"metric": "mean_size",
"value": 640398,
"value_prev": null,
"app_type": "logsize"
},
{
"metric": "median_size",
"value": 640398,
"value_prev": null,
"app_type": "logsize"
},
{
"metric": "min_size",
"value": 640398,
"value_prev": null,
"app_type": "logsize"
},
{
"metric": "mode_size",
"value": 640398,
"value_prev": null,
"app_type": "logsize"
},
{
"metric": "set_var_log_max_size",
"value": 212661,
"value_prev": null,
"app_type": "logsize"
},
{
"metric": "set_var_log_mean_size",
"value": 32019.9,
"value_prev": null,
"app_type": "logsize"
},
{
"metric": "set_var_log_median_size",
"value": 2273.5,
"value_prev": null,
"app_type": "logsize"
},
{
"metric": "set_var_log_min_size",
"value": 0,
"value_prev": null,
"app_type": "logsize"
},
{
"metric": "set_var_log_mode_size",
"value": 62,
"value_prev": null,
"app_type": "logsize"
},
{
"metric": "set_var_log_size",
"value": 640398,
"value_prev": null,
"app_type": "logsize"
},
{
"metric": "size",
"value": 640398,
"value_prev": null,
"app_type": "logsize"
}
]
}
}
}