From 2618a99be5edf30b015fd76d2d56462ca0c94053 Mon Sep 17 00:00:00 2001 From: "Zane C. Bowers-Hadley" Date: Wed, 6 Sep 2023 16:34:39 -0500 Subject: [PATCH] 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 --- app/Models/Application.php | 4 +- app/Observers/DeviceObserver.php | 2 +- app/Observers/ModuleModelObserver.php | 9 ++++ ...0_105156_add_applications_soft_deleted.php | 32 ++++++++++++++ includes/discovery/applications.inc.php | 44 +++++++------------ .../html/forms/application-update.inc.php | 21 +++++---- includes/html/pages/device/edit/apps.inc.php | 2 +- misc/db_schema.yaml | 1 + tests/data/beagleboard.json | 6 ++- tests/data/linux_asterisk-v1.json | 6 ++- tests/data/linux_cape-v1.json | 6 ++- tests/data/linux_certificate-v1.json | 6 ++- tests/data/linux_chronyd.json | 6 ++- tests/data/linux_docker-v1.json | 6 ++- tests/data/linux_docker-v2.json | 6 ++- tests/data/linux_fail2ban-legacy.json | 6 ++- tests/data/linux_fail2ban-v1.json | 6 ++- tests/data/linux_fbsd-nfs-client-legacy.json | 6 ++- tests/data/linux_fbsd-nfs-client-v1.json | 6 ++- tests/data/linux_fbsd-nfs-server-legacy.json | 6 ++- tests/data/linux_fbsd-nfs-server-v1.json | 6 ++- tests/data/linux_freeradius.json | 6 ++- tests/data/linux_hv-monitor-v1.json | 6 ++- tests/data/linux_icecast.json | 6 ++- tests/data/linux_linux_config_files-v1.json | 6 ++- tests/data/linux_linux_softnet_stat-v1.json | 6 ++- tests/data/linux_logsize-v1.json | 6 ++- tests/data/linux_lsi.json | 6 ++- tests/data/linux_mailcow-dockerized-v1.json | 6 ++- tests/data/linux_mojo_cape_submit-v1.json | 6 ++- tests/data/linux_ntp-client-legacy.json | 6 ++- tests/data/linux_ntp-client-v1.json | 6 ++- tests/data/linux_opensearch-v1.json | 6 ++- tests/data/linux_opensips.json | 12 +++-- tests/data/linux_portactivity-v1.json | 6 ++- tests/data/linux_powerdns-legacy.json | 6 ++- tests/data/linux_powerdns-v1.json | 6 ++- tests/data/linux_powermon.json | 6 ++- tests/data/linux_privoxy-v1.json | 6 ++- tests/data/linux_pwrstatd-v1.json | 6 ++- tests/data/linux_seafile-v1.json | 6 ++- tests/data/linux_smart-legacy.json | 6 ++- tests/data/linux_smart-v1.json | 6 ++- tests/data/linux_sneck-v1.json | 6 ++- tests/data/linux_supervisord-v1.json | 6 ++- tests/data/linux_suricata-v1.json | 6 ++- tests/data/linux_suricata_extract-v1.json | 6 ++- tests/data/linux_systemd-v1.json | 6 ++- tests/data/linux_ups-apcups-legacy.json | 6 ++- tests/data/linux_ups-apcups-v1.json | 6 ++- tests/data/linux_wireguard-v1.json | 6 ++- tests/data/linux_zfs-legacy.json | 6 ++- tests/data/linux_zfs-v1-compressed.json | 6 ++- tests/data/linux_zfs-v1.json | 6 ++- tests/data/linux_zfs-v3.json | 6 ++- 55 files changed, 269 insertions(+), 134 deletions(-) create mode 100644 database/migrations/2023_08_30_105156_add_applications_soft_deleted.php diff --git a/app/Models/Application.php b/app/Models/Application.php index 7e025ab3af9a..c3100f30c845 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -25,13 +25,15 @@ namespace App\Models; +use Illuminate\Database\Eloquent\SoftDeletes; use LibreNMS\Util\StringHelpers; class Application extends DeviceRelatedModel { + use SoftDeletes; public $timestamps = false; protected $primaryKey = 'app_id'; - protected $fillable = ['data']; + protected $fillable = ['device_id', 'app_type', 'app_instance', 'app_status', 'app_state', 'data', 'deleted_at', 'discovered']; protected $casts = [ 'data' => 'array', ]; diff --git a/app/Observers/DeviceObserver.php b/app/Observers/DeviceObserver.php index 1a7e5348b23f..2fd33a305e4d 100644 --- a/app/Observers/DeviceObserver.php +++ b/app/Observers/DeviceObserver.php @@ -96,7 +96,7 @@ public function deleting(Device $device): void $device->alerts()->delete(); \DB::table('alert_device_map')->where('device_id', $device->device_id)->delete(); $device->alertLogs()->delete(); - $device->applications()->delete(); + $device->applications()->forceDelete(); $device->attribs()->delete(); $device->availability()->delete(); $device->bgppeers()->delete(); diff --git a/app/Observers/ModuleModelObserver.php b/app/Observers/ModuleModelObserver.php index 2ea6d661053f..db206833160e 100644 --- a/app/Observers/ModuleModelObserver.php +++ b/app/Observers/ModuleModelObserver.php @@ -63,6 +63,15 @@ public function updated($model): void d_echo($model->getDirty()); } + /** + * @param Eloquent $model + */ + public function restored($model) + { + d_echo('Restored data:', 'R'); + d_echo($model->getDirty()); + } + /** * @param Eloquent $model */ diff --git a/database/migrations/2023_08_30_105156_add_applications_soft_deleted.php b/database/migrations/2023_08_30_105156_add_applications_soft_deleted.php new file mode 100644 index 000000000000..afaddc27dfa8 --- /dev/null +++ b/database/migrations/2023_08_30_105156_add_applications_soft_deleted.php @@ -0,0 +1,32 @@ +softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('applications', function (Blueprint $table) { + $table->dropColumn('deleted_at'); + }); + } +} diff --git a/includes/discovery/applications.inc.php b/includes/discovery/applications.inc.php index e12ffe93cc2d..f478c1085bbc 100644 --- a/includes/discovery/applications.inc.php +++ b/includes/discovery/applications.inc.php @@ -23,6 +23,8 @@ * @author Tony Murray */ +use App\Models\Application; +use App\Observers\ModuleModelObserver; use LibreNMS\Config; echo "\nApplications: "; @@ -56,7 +58,7 @@ // Generate a list of enabled apps and a list of all discovered apps from the db [$enabled_apps, $discovered_apps] = array_reduce(dbFetchRows( - 'SELECT `app_type`,`discovered` FROM `applications` WHERE `device_id`=? ORDER BY `app_type`', + 'SELECT `app_type`,`discovered` FROM `applications` WHERE `device_id`=? AND deleted_at IS NULL ORDER BY `app_type`', [$device['device_id']] ), function ($result, $app) { $result[0][] = $app['app_type']; @@ -67,6 +69,9 @@ return $result; }, [[], []]); +// enable observer for printing changes +ModuleModelObserver::observe(\App\Models\Application::class); + // Enable applications $current_apps = []; foreach ($results as $extend => $result) { @@ -74,18 +79,13 @@ $app = $applications[$extend]; $current_apps[] = $app; - if (in_array($app, $enabled_apps)) { - echo '.'; - } else { - dbInsert([ - 'device_id' => $device['device_id'], - 'app_type' => $app, - 'discovered' => 1, - 'app_status' => '', - 'app_instance' => '', - ], 'applications'); - - echo '+'; + if (! in_array($app, $enabled_apps)) { + $app_obj = Application::withTrashed()->firstOrNew(['device_id' => $device['device_id'], 'app_type' => $app]); + if ($app_obj->trashed()) { + $app_obj->restore(); + } + $app_obj->discovered = 1; + $app_obj->save(); log_event("Application enabled by discovery: $app", $device, 'application', 1); } } @@ -93,20 +93,10 @@ // remove non-existing apps $apps_to_remove = array_diff($discovered_apps, $current_apps); -$num = count($apps_to_remove); -if ($num > 0) { - echo str_repeat('-', $num); - $vars = $apps_to_remove; - array_unshift($vars, $device['device_id']); - dbDelete( - 'applications', - '`device_id`=? AND `app_type` IN ' . dbGenPlaceholders($num), - $vars - ); - foreach ($apps_to_remove as $app) { - log_event("Application disabled by discovery: $app", $device, 'application', 3); - } -} +DeviceCache::getPrimary()->applications()->whereIn('app_type', $apps_to_remove)->get()->each(function (Application $app) { + $app->delete(); + \App\Models\Eventlog::log("Application disabled by discovery: $app->app_type", DeviceCache::getPrimary(), 'application', \LibreNMS\Enum\Severity::Notice); +}); // clean application_metrics dbDeleteOrphans('application_metrics', ['applications.app_id']); diff --git a/includes/html/forms/application-update.inc.php b/includes/html/forms/application-update.inc.php index 74c52e0ccd8e..8b13752761a3 100644 --- a/includes/html/forms/application-update.inc.php +++ b/includes/html/forms/application-update.inc.php @@ -22,6 +22,8 @@ * @copyright 2017 Tony Murray * @author Tony Murray */ +use App\Models\Application; + if (! Auth::user()->hasGlobalAdmin()) { $status = ['status' => 1, 'message' => 'You need to be admin']; } else { @@ -32,21 +34,24 @@ $status = ['status' => 1, 'message' => 'Error with data']; } else { $status = ['status' => 1, 'message' => 'Database update failed']; + $app = Application::withTrashed()->firstOrNew(['device_id' => $device_id, 'app_type' => $app]); if ($_POST['state'] == 'true') { - $update = [ - 'device_id' => $device_id, - 'app_type' => $app, - 'app_status' => '', - 'app_instance' => '', - ]; - if (dbInsert($update, 'applications')) { + if ($app->trashed()) { + $app->restore(); + } + if ($app->save()) { log_event("Application enabled by user: $app", $device_id, 'application', 1); $status = ['status' => 0, 'message' => 'Application enabled']; + } else { + $status = ['status' => 1, 'message' => 'Database update for enabling the application failed']; } } else { - if (dbDelete('applications', '`device_id`=? AND `app_type`=?', [$device_id, $app])) { + $app->delete(); + if ($app->save()) { log_event("Application disabled by user: $app", $device_id, 'application', 3); $status = ['status' => 0, 'message' => 'Application disabled']; + } else { + $status = ['status' => 1, 'message' => 'Database update for disabling the application failed']; } } } diff --git a/includes/html/pages/device/edit/apps.inc.php b/includes/html/pages/device/edit/apps.inc.php index f482279f927c..b4735ec38cf9 100644 --- a/includes/html/pages/device/edit/apps.inc.php +++ b/includes/html/pages/device/edit/apps.inc.php @@ -11,7 +11,7 @@ // Generate a list of enabled apps with a value of whether they are discovered or not $enabled_apps = array_reduce(dbFetchRows( - 'SELECT `app_type`,`discovered` FROM `applications` WHERE `device_id`=? ORDER BY `app_type`', + 'SELECT `app_type`,`discovered` FROM `applications` WHERE `device_id`=? AND deleted_at IS NULL ORDER BY `app_type`', [$device['device_id']] ), function ($result, $app) { $result[$app['app_type']] = $app['discovered']; diff --git a/misc/db_schema.yaml b/misc/db_schema.yaml index 729c6b859e45..0bf081f7bace 100644 --- a/misc/db_schema.yaml +++ b/misc/db_schema.yaml @@ -187,6 +187,7 @@ applications: - { Field: timestamp, Type: timestamp, 'Null': false, Extra: 'on update CURRENT_TIMESTAMP', Default: CURRENT_TIMESTAMP } - { Field: app_instance, Type: varchar(255), 'Null': false, Extra: '', Default: '' } - { Field: data, Type: longtext, 'Null': true, Extra: '' } + - { Field: deleted_at, Type: timestamp, 'Null': true, Extra: '' } Indexes: PRIMARY: { Name: PRIMARY, Columns: [app_id], Unique: true, Type: BTREE } applications_device_id_app_type_unique: { Name: applications_device_id_app_type_unique, Columns: [device_id, app_type], Unique: true, Type: BTREE } diff --git a/tests/data/beagleboard.json b/tests/data/beagleboard.json index 91b53bf96cc1..87d599e15d6b 100644 --- a/tests/data/beagleboard.json +++ b/tests/data/beagleboard.json @@ -1674,7 +1674,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -1687,7 +1688,8 @@ "app_state_prev": "UNKNOWN", "app_status": "18", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_asterisk-v1.json b/tests/data/linux_asterisk-v1.json index 9268e3b43869..17e560534bce 100644 --- a/tests/data/linux_asterisk-v1.json +++ b/tests/data/linux_asterisk-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_cape-v1.json b/tests/data/linux_cape-v1.json index 4bc92ca72a57..6938459cf2c9 100644 --- a/tests/data/linux_cape-v1.json +++ b/tests/data/linux_cape-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_certificate-v1.json b/tests/data/linux_certificate-v1.json index e0aba58a6080..1fdaf21caf22 100644 --- a/tests/data/linux_certificate-v1.json +++ b/tests/data/linux_certificate-v1.json @@ -30,7 +30,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -43,7 +44,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_chronyd.json b/tests/data/linux_chronyd.json index c27deb7330e7..b26c8b9d5830 100644 --- a/tests/data/linux_chronyd.json +++ b/tests/data/linux_chronyd.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"sources\":[\"PPS\",\"GPS\"]}" + "data": "{\"sources\":[\"PPS\",\"GPS\"]}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_docker-v1.json b/tests/data/linux_docker-v1.json index 1e4656d9dfaf..5cb6e57c6ac1 100644 --- a/tests/data/linux_docker-v1.json +++ b/tests/data/linux_docker-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "LEGACY", "app_instance": "", - "data": "{\"containers\":[\"foobar_laravel.test_1\",\"foobar_dashboard_1\",\"foobar_meilisearch_1\",\"foobar_mysql_1\",\"foobar_redis_1\"]}" + "data": "{\"containers\":[\"foobar_laravel.test_1\",\"foobar_dashboard_1\",\"foobar_meilisearch_1\",\"foobar_mysql_1\",\"foobar_redis_1\"]}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_docker-v2.json b/tests/data/linux_docker-v2.json index 7a1029c3084a..05d281455713 100644 --- a/tests/data/linux_docker-v2.json +++ b/tests/data/linux_docker-v2.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"containers\":[\"foobar_laravel.test_1\",\"foobar_dashboard_1\",\"foobar_meilisearch_1\",\"foobar_mysql_1\",\"foobar_redis_1\"]}" + "data": "{\"containers\":[\"foobar_laravel.test_1\",\"foobar_dashboard_1\",\"foobar_meilisearch_1\",\"foobar_mysql_1\",\"foobar_redis_1\"]}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_fail2ban-legacy.json b/tests/data/linux_fail2ban-legacy.json index 5bec02b3d587..0f94fc87e24a 100644 --- a/tests/data/linux_fail2ban-legacy.json +++ b/tests/data/linux_fail2ban-legacy.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"jails\":[\"dovecot\",\"sshd\"]}" + "data": "{\"jails\":[\"dovecot\",\"sshd\"]}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_fail2ban-v1.json b/tests/data/linux_fail2ban-v1.json index 7ea54a224f14..5ab794704bd1 100644 --- a/tests/data/linux_fail2ban-v1.json +++ b/tests/data/linux_fail2ban-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"jails\":[\"sshd\",\"dovecot\"]}" + "data": "{\"jails\":[\"sshd\",\"dovecot\"]}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_fbsd-nfs-client-legacy.json b/tests/data/linux_fbsd-nfs-client-legacy.json index 69a45041fc9b..914d676b1daf 100644 --- a/tests/data/linux_fbsd-nfs-client-legacy.json +++ b/tests/data/linux_fbsd-nfs-client-legacy.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_fbsd-nfs-client-v1.json b/tests/data/linux_fbsd-nfs-client-v1.json index e58552010e32..ff3455b2a387 100644 --- a/tests/data/linux_fbsd-nfs-client-v1.json +++ b/tests/data/linux_fbsd-nfs-client-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_fbsd-nfs-server-legacy.json b/tests/data/linux_fbsd-nfs-server-legacy.json index 5f60b47dcaf0..5e1733a8d91e 100644 --- a/tests/data/linux_fbsd-nfs-server-legacy.json +++ b/tests/data/linux_fbsd-nfs-server-legacy.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_fbsd-nfs-server-v1.json b/tests/data/linux_fbsd-nfs-server-v1.json index 5f60b47dcaf0..5e1733a8d91e 100644 --- a/tests/data/linux_fbsd-nfs-server-v1.json +++ b/tests/data/linux_fbsd-nfs-server-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_freeradius.json b/tests/data/linux_freeradius.json index 2bc05583d4a2..1b05018e75df 100644 --- a/tests/data/linux_freeradius.json +++ b/tests/data/linux_freeradius.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_hv-monitor-v1.json b/tests/data/linux_hv-monitor-v1.json index 2d4885217c35..17f88d11c245 100644 --- a/tests/data/linux_hv-monitor-v1.json +++ b/tests/data/linux_hv-monitor-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"hv\":\"libvirt\",\"VMs\":[\"cuckoo70\",\"cuckoo71\",\"cuckoo72\",\"win10\",\"win10-base\"],\"VMdisks\":{\"cuckoo70\":[\"sda\",\"sdb\"],\"cuckoo71\":[\"sda\",\"sdb\"],\"cuckoo72\":[\"sda\",\"sdb\"],\"win10\":[\"sda\",\"sdb\"],\"win10-base\":[\"sda\",\"sdb\"]},\"VMdifs\":[],\"VMdstatus\":[],\"VMifs\":{\"cuckoo70\":[],\"cuckoo71\":[],\"cuckoo72\":[],\"win10\":[],\"win10-base\":[]}}" + "data": "{\"hv\":\"libvirt\",\"VMs\":[\"cuckoo70\",\"cuckoo71\",\"cuckoo72\",\"win10\",\"win10-base\"],\"VMdisks\":{\"cuckoo70\":[\"sda\",\"sdb\"],\"cuckoo71\":[\"sda\",\"sdb\"],\"cuckoo72\":[\"sda\",\"sdb\"],\"win10\":[\"sda\",\"sdb\"],\"win10-base\":[\"sda\",\"sdb\"]},\"VMdifs\":[],\"VMdstatus\":[],\"VMifs\":{\"cuckoo70\":[],\"cuckoo71\":[],\"cuckoo72\":[],\"win10\":[],\"win10-base\":[]}}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_icecast.json b/tests/data/linux_icecast.json index 37d747ec6cd3..2c41ca936bf0 100644 --- a/tests/data/linux_icecast.json +++ b/tests/data/linux_icecast.json @@ -879,7 +879,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -892,7 +893,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_linux_config_files-v1.json b/tests/data/linux_linux_config_files-v1.json index 9f006a692117..357eb5a48418 100644 --- a/tests/data/linux_linux_config_files-v1.json +++ b/tests/data/linux_linux_config_files-v1.json @@ -30,7 +30,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -43,7 +44,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_linux_softnet_stat-v1.json b/tests/data/linux_linux_softnet_stat-v1.json index 35353299edea..9905d60d884b 100644 --- a/tests/data/linux_linux_softnet_stat-v1.json +++ b/tests/data/linux_linux_softnet_stat-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"budget\":\"300\",\"budget_usecs\":\"8000\"}" + "data": "{\"budget\":\"300\",\"budget_usecs\":\"8000\"}", + "deleted_at": null } }, "application_metrics": [ diff --git a/tests/data/linux_logsize-v1.json b/tests/data/linux_logsize-v1.json index 6e04fab0b32e..8d78f5e7feeb 100644 --- a/tests/data/linux_logsize-v1.json +++ b/tests/data/linux_logsize-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "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}" + "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": [ diff --git a/tests/data/linux_lsi.json b/tests/data/linux_lsi.json index ad2474dfe96d..02b5d5c75b4e 100644 --- a/tests/data/linux_lsi.json +++ b/tests/data/linux_lsi.json @@ -11098,7 +11098,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -11111,7 +11112,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] } diff --git a/tests/data/linux_mailcow-dockerized-v1.json b/tests/data/linux_mailcow-dockerized-v1.json index d83e1a2b7ff2..c572cc8cd284 100644 --- a/tests/data/linux_mailcow-dockerized-v1.json +++ b/tests/data/linux_mailcow-dockerized-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_mojo_cape_submit-v1.json b/tests/data/linux_mojo_cape_submit-v1.json index 5c4977bb3d94..bb26f696a4ac 100644 --- a/tests/data/linux_mojo_cape_submit-v1.json +++ b/tests/data/linux_mojo_cape_submit-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"slugs\":[]}" + "data": "{\"slugs\":[]}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_ntp-client-legacy.json b/tests/data/linux_ntp-client-legacy.json index 12b3cf534d2e..533fbe86818c 100644 --- a/tests/data/linux_ntp-client-legacy.json +++ b/tests/data/linux_ntp-client-legacy.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_ntp-client-v1.json b/tests/data/linux_ntp-client-v1.json index 12b3cf534d2e..533fbe86818c 100644 --- a/tests/data/linux_ntp-client-v1.json +++ b/tests/data/linux_ntp-client-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_opensearch-v1.json b/tests/data/linux_opensearch-v1.json index 71262cdf3050..da35a9a24075 100644 --- a/tests/data/linux_opensearch-v1.json +++ b/tests/data/linux_opensearch-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"cluster\":\"vulpes\"}" + "data": "{\"cluster\":\"vulpes\"}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_opensips.json b/tests/data/linux_opensips.json index f6471d68e24f..871bf5641a3f 100644 --- a/tests/data/linux_opensips.json +++ b/tests/data/linux_opensips.json @@ -705,7 +705,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null }, { "app_type": "opensips", @@ -714,7 +715,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -727,7 +729,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null }, { "app_type": "opensips", @@ -736,7 +739,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_portactivity-v1.json b/tests/data/linux_portactivity-v1.json index e9b8b254aeed..80e94d447181 100644 --- a/tests/data/linux_portactivity-v1.json +++ b/tests/data/linux_portactivity-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"ports\":[\"ssh\"]}" + "data": "{\"ports\":[\"ssh\"]}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_powerdns-legacy.json b/tests/data/linux_powerdns-legacy.json index 328d3a6ed019..1868c8f36bfc 100644 --- a/tests/data/linux_powerdns-legacy.json +++ b/tests/data/linux_powerdns-legacy.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_powerdns-v1.json b/tests/data/linux_powerdns-v1.json index 045ff50638f4..e72cb898e86b 100644 --- a/tests/data/linux_powerdns-v1.json +++ b/tests/data/linux_powerdns-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_powermon.json b/tests/data/linux_powermon.json index d818ba0c2b08..22b1b0a6818a 100644 --- a/tests/data/linux_powermon.json +++ b/tests/data/linux_powermon.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_privoxy-v1.json b/tests/data/linux_privoxy-v1.json index 0bbfbf990a46..ccff11de6805 100644 --- a/tests/data/linux_privoxy-v1.json +++ b/tests/data/linux_privoxy-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_pwrstatd-v1.json b/tests/data/linux_pwrstatd-v1.json index 03655525bd93..72cbc7806714 100644 --- a/tests/data/linux_pwrstatd-v1.json +++ b/tests/data/linux_pwrstatd-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_seafile-v1.json b/tests/data/linux_seafile-v1.json index f3aff758aaac..8126cfa80427 100644 --- a/tests/data/linux_seafile-v1.json +++ b/tests/data/linux_seafile-v1.json @@ -30,7 +30,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -43,7 +44,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_smart-legacy.json b/tests/data/linux_smart-legacy.json index 02a54e7b0ce9..7e15041da6d6 100644 --- a/tests/data/linux_smart-legacy.json +++ b/tests/data/linux_smart-legacy.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"disks\":{\"Z304VCFY\":{\"10\":\"0\",\"173\":\"null\",\"177\":\"null\",\"183\":\"0\",\"184\":\"0\",\"187\":\"0\",\"188\":\"0\",\"190\":\"35\",\"194\":\"35\",\"196\":\"null\",\"197\":\"0\",\"198\":\"0\",\"199\":\"0\",\"231\":\"null\",\"233\":\"null\",\"5\":\"0\",\"9\":null,\"completed\":\"5\",\"interrupted\":\"1\",\"read_failure\":\"0\",\"unknown_failure\":\"0\",\"extended\":\"6\",\"short\":\"0\",\"conveyance\":\"0\",\"selective\":\"selective\",\"is_ssd\":0}},\"legacy\":1,\"disks_with_failed_tests\":[],\"disks_with_failed_health\":[],\"has\":{\"id5\":1,\"id9\":0,\"id10\":1,\"id173\":0,\"id177\":0,\"id183\":1,\"id184\":1,\"id187\":1,\"id188\":1,\"id190\":1,\"id194\":1,\"id196\":0,\"id197\":1,\"id198\":1,\"id199\":1,\"id231\":0,\"id232\":0,\"id233\":0}}" + "data": "{\"disks\":{\"Z304VCFY\":{\"10\":\"0\",\"173\":\"null\",\"177\":\"null\",\"183\":\"0\",\"184\":\"0\",\"187\":\"0\",\"188\":\"0\",\"190\":\"35\",\"194\":\"35\",\"196\":\"null\",\"197\":\"0\",\"198\":\"0\",\"199\":\"0\",\"231\":\"null\",\"233\":\"null\",\"5\":\"0\",\"9\":null,\"completed\":\"5\",\"interrupted\":\"1\",\"read_failure\":\"0\",\"unknown_failure\":\"0\",\"extended\":\"6\",\"short\":\"0\",\"conveyance\":\"0\",\"selective\":\"selective\",\"is_ssd\":0}},\"legacy\":1,\"disks_with_failed_tests\":[],\"disks_with_failed_health\":[],\"has\":{\"id5\":1,\"id9\":0,\"id10\":1,\"id173\":0,\"id177\":0,\"id183\":1,\"id184\":1,\"id187\":1,\"id188\":1,\"id190\":1,\"id194\":1,\"id196\":0,\"id197\":1,\"id198\":1,\"id199\":1,\"id231\":0,\"id232\":0,\"id233\":0}}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_smart-v1.json b/tests/data/linux_smart-v1.json index 82db18428842..b0534aeb7e4c 100644 --- a/tests/data/linux_smart-v1.json +++ b/tests/data/linux_smart-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"disks\":{\"da0\":{\"10\":\"0\",\"173\":\"null\",\"177\":\"null\",\"183\":\"0\",\"184\":\"0\",\"187\":\"0\",\"188\":0,\"190\":\"34\",\"194\":\"34\",\"196\":\"null\",\"197\":\"0\",\"198\":\"0\",\"199\":\"0\",\"231\":\"null\",\"232\":\"null\",\"233\":\"null\",\"5\":\"0\",\"9\":\"63417\",\"completed\":5,\"conveyance\":\"0\",\"device_model\":\"ST4000DM000-1F2168\",\"disk\":\"da0 -d sat\",\"exit\":0,\"extended\":6,\"fw_version\":\"CC54\",\"health_pass\":1,\"interrupted\":1,\"max_temp\":\"34\",\"model_family\":\"Seagate Desktop HDD.15\",\"offline\":\"0\",\"read_failure\":\"0\",\"selective\":\"0\",\"selftest_log\":\"Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_errorn# 1 Extended offline Completed without error 00% 63322 -n# 2 Extended offline Completed without error 00% 32177 -n# 3 Extended offline Completed without error 00% 9042 -n# 4 Extended offline Completed without error 00% 8432 -n# 5 Extended offline Completed without error 00% 29 -n# 6 Extended offline Interrupted (host reset) 00% 0 -\",\"serial\":\"Z304VCFY\",\"short\":\"0\",\"unknown_failure\":\"0\",\"is_ssd\":0}},\"exit_nonzero\":0,\"unhealthy\":0,\"disks_with_failed_tests\":[],\"disks_with_failed_health\":[],\"has\":{\"id5\":1,\"id9\":1,\"id10\":1,\"id173\":0,\"id177\":0,\"id183\":1,\"id184\":1,\"id187\":1,\"id188\":1,\"id190\":1,\"id194\":1,\"id196\":0,\"id197\":1,\"id198\":1,\"id199\":1,\"id231\":0,\"id232\":0,\"id233\":0}}" + "data": "{\"disks\":{\"da0\":{\"10\":\"0\",\"173\":\"null\",\"177\":\"null\",\"183\":\"0\",\"184\":\"0\",\"187\":\"0\",\"188\":0,\"190\":\"34\",\"194\":\"34\",\"196\":\"null\",\"197\":\"0\",\"198\":\"0\",\"199\":\"0\",\"231\":\"null\",\"232\":\"null\",\"233\":\"null\",\"5\":\"0\",\"9\":\"63417\",\"completed\":5,\"conveyance\":\"0\",\"device_model\":\"ST4000DM000-1F2168\",\"disk\":\"da0 -d sat\",\"exit\":0,\"extended\":6,\"fw_version\":\"CC54\",\"health_pass\":1,\"interrupted\":1,\"max_temp\":\"34\",\"model_family\":\"Seagate Desktop HDD.15\",\"offline\":\"0\",\"read_failure\":\"0\",\"selective\":\"0\",\"selftest_log\":\"Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_errorn# 1 Extended offline Completed without error 00% 63322 -n# 2 Extended offline Completed without error 00% 32177 -n# 3 Extended offline Completed without error 00% 9042 -n# 4 Extended offline Completed without error 00% 8432 -n# 5 Extended offline Completed without error 00% 29 -n# 6 Extended offline Interrupted (host reset) 00% 0 -\",\"serial\":\"Z304VCFY\",\"short\":\"0\",\"unknown_failure\":\"0\",\"is_ssd\":0}},\"exit_nonzero\":0,\"unhealthy\":0,\"disks_with_failed_tests\":[],\"disks_with_failed_health\":[],\"has\":{\"id5\":1,\"id9\":1,\"id10\":1,\"id173\":0,\"id177\":0,\"id183\":1,\"id184\":1,\"id187\":1,\"id188\":1,\"id190\":1,\"id194\":1,\"id196\":0,\"id197\":1,\"id198\":1,\"id199\":1,\"id231\":0,\"id232\":0,\"id233\":0}}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_sneck-v1.json b/tests/data/linux_sneck-v1.json index 7ff5a6cf318f..1a5ec180d330 100644 --- a/tests/data/linux_sneck-v1.json +++ b/tests/data/linux_sneck-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"data\":{\"alert\":0,\"alertString\":\"\",\"checks\":{\"clamav\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_clamav -w 2 -c 3\",\"exit\":0,\"output\":\"ClamAV OK: daily.cvd 26579 (Tue Jun 21 08:15:30 2022) is up to date\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_clamav -w 2 -c 3\"},\"entropy\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_entropy\",\"exit\":0,\"output\":\"OK: 3649 bytes in the pool.|entropy=3649 bytes\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_entropy\"},\"http\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_http -H 127.0.0.1:8000\",\"exit\":0,\"output\":\"HTTP OK: HTTP\\/1.1 200 OK - 6249 bytes in 0.057 second response time |time=0.057237s;;;0.000000;10.000000 size=6249B;;;0\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_http -H 127.0.0.1:8000\"},\"ipmi_sensor\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_ipmi_sensor --nosel\",\"exit\":0,\"output\":\"IPMI Status: OK | 'CPU Temp'=50.00;0.00:97.00;0.00:102.00 'System Temp'=37.00;0.00:80.00;-5.00:85.00 'Peripheral Temp'=47.00;0.00:80.00;-5.00:85.00 'DIMMB1 Temp'=36.00;5.00:80.00;0.00:85.00 'DIMMB2 Temp'=38.00;5.00:80.00;0.00:85.00 'FAN1'=4100.00;700.00:25300.00;500.00:25400.00 'FAN2'=3400.00;700.00:25300.00;500.00:25400.00 'FAN3'=4300.00;700.00:25300.00;500.00:25400.00 'VCCP'=1.86;1.57:2.02;1.46:2.13 'VDIMM'=1.20;1.05:1.34;0.97:1.43 '12V'=12.13;10.78:12.96;10.27:13.28 '5VCC'=5.03;4.48:5.39;4.30:5.55 '3.3VCC'=3.40;2.96:3.55;2.82:3.66 'VBAT'=3.14;2.59:3.49;2.47:3.57 '5V Dual'=5.00;4.49:5.38;4.30:5.54 '3.3V AUX'=3.32;2.96:3.55;2.82:3.66\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_ipmi_sensor --nosel\"},\"mongodb\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_mongodb.py\",\"exit\":0,\"output\":\"OK - Connection took 0.011 seconds\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_mongodb.py\"},\"raid\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_raid\",\"exit\":0,\"output\":\"OK: mdstat:[md0(2.73 TiB raid1):UU]\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_raid\"},\"virtqemud_procs\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_procs --ereg-argument-array '^\\/usr\\/sbin\\/virtqemud' 1:2\",\"exit\":0,\"output\":\"PROCS OK: 1 process with regex args '^\\/usr\\/sbin\\/virtqemud' | procs=1;1:2;;0;\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_procs --ereg-argument-array '^\\/usr\\/sbin\\/virtqemud' 1:2\"}},\"critical\":0,\"errored\":0,\"hostname\":\"nagi\",\"ok\":7,\"time\":1655835901,\"unknown\":0,\"vars\":[],\"warning\":0},\"error\":0,\"errorString\":\"\",\"version\":1}" + "data": "{\"data\":{\"alert\":0,\"alertString\":\"\",\"checks\":{\"clamav\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_clamav -w 2 -c 3\",\"exit\":0,\"output\":\"ClamAV OK: daily.cvd 26579 (Tue Jun 21 08:15:30 2022) is up to date\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_clamav -w 2 -c 3\"},\"entropy\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_entropy\",\"exit\":0,\"output\":\"OK: 3649 bytes in the pool.|entropy=3649 bytes\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_entropy\"},\"http\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_http -H 127.0.0.1:8000\",\"exit\":0,\"output\":\"HTTP OK: HTTP\\/1.1 200 OK - 6249 bytes in 0.057 second response time |time=0.057237s;;;0.000000;10.000000 size=6249B;;;0\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_http -H 127.0.0.1:8000\"},\"ipmi_sensor\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_ipmi_sensor --nosel\",\"exit\":0,\"output\":\"IPMI Status: OK | 'CPU Temp'=50.00;0.00:97.00;0.00:102.00 'System Temp'=37.00;0.00:80.00;-5.00:85.00 'Peripheral Temp'=47.00;0.00:80.00;-5.00:85.00 'DIMMB1 Temp'=36.00;5.00:80.00;0.00:85.00 'DIMMB2 Temp'=38.00;5.00:80.00;0.00:85.00 'FAN1'=4100.00;700.00:25300.00;500.00:25400.00 'FAN2'=3400.00;700.00:25300.00;500.00:25400.00 'FAN3'=4300.00;700.00:25300.00;500.00:25400.00 'VCCP'=1.86;1.57:2.02;1.46:2.13 'VDIMM'=1.20;1.05:1.34;0.97:1.43 '12V'=12.13;10.78:12.96;10.27:13.28 '5VCC'=5.03;4.48:5.39;4.30:5.55 '3.3VCC'=3.40;2.96:3.55;2.82:3.66 'VBAT'=3.14;2.59:3.49;2.47:3.57 '5V Dual'=5.00;4.49:5.38;4.30:5.54 '3.3V AUX'=3.32;2.96:3.55;2.82:3.66\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_ipmi_sensor --nosel\"},\"mongodb\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_mongodb.py\",\"exit\":0,\"output\":\"OK - Connection took 0.011 seconds\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_mongodb.py\"},\"raid\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_raid\",\"exit\":0,\"output\":\"OK: mdstat:[md0(2.73 TiB raid1):UU]\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_raid\"},\"virtqemud_procs\":{\"check\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_procs --ereg-argument-array '^\\/usr\\/sbin\\/virtqemud' 1:2\",\"exit\":0,\"output\":\"PROCS OK: 1 process with regex args '^\\/usr\\/sbin\\/virtqemud' | procs=1;1:2;;0;\",\"ran\":\"\\/usr\\/lib\\/nagios\\/plugins\\/check_procs --ereg-argument-array '^\\/usr\\/sbin\\/virtqemud' 1:2\"}},\"critical\":0,\"errored\":0,\"hostname\":\"nagi\",\"ok\":7,\"time\":1655835901,\"unknown\":0,\"vars\":[],\"warning\":0},\"error\":0,\"errorString\":\"\",\"version\":1}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_supervisord-v1.json b/tests/data/linux_supervisord-v1.json index e287334c2eb8..92085886f5c1 100644 --- a/tests/data/linux_supervisord-v1.json +++ b/tests/data/linux_supervisord-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_suricata-v1.json b/tests/data/linux_suricata-v1.json index 8eaff6f9ff7d..b3afce6629d5 100644 --- a/tests/data/linux_suricata-v1.json +++ b/tests/data/linux_suricata-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"instances\":[\"ids\"]}" + "data": "{\"instances\":[\"ids\"]}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_suricata_extract-v1.json b/tests/data/linux_suricata_extract-v1.json index 0bd2af903ea8..6f28e300ea59 100644 --- a/tests/data/linux_suricata_extract-v1.json +++ b/tests/data/linux_suricata_extract-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_systemd-v1.json b/tests/data/linux_systemd-v1.json index 80b77405f614..d564dae87263 100644 --- a/tests/data/linux_systemd-v1.json +++ b/tests/data/linux_systemd-v1.json @@ -30,7 +30,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -43,7 +44,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_ups-apcups-legacy.json b/tests/data/linux_ups-apcups-legacy.json index fe2c5e945560..5c1290be9e1f 100644 --- a/tests/data/linux_ups-apcups-legacy.json +++ b/tests/data/linux_ups-apcups-legacy.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_ups-apcups-v1.json b/tests/data/linux_ups-apcups-v1.json index fe2c5e945560..5c1290be9e1f 100644 --- a/tests/data/linux_ups-apcups-v1.json +++ b/tests/data/linux_ups-apcups-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_wireguard-v1.json b/tests/data/linux_wireguard-v1.json index 7197cb871228..54b42fff60a7 100644 --- a/tests/data/linux_wireguard-v1.json +++ b/tests/data/linux_wireguard-v1.json @@ -30,7 +30,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -43,7 +44,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"mappings\":{\"wg0\":[\"client1.domain.com\",\"client2\",\"my_phone\",\"it_admin.domain.org\",\"computer\"]}}" + "data": "{\"mappings\":{\"wg0\":[\"client1.domain.com\",\"client2\",\"my_phone\",\"it_admin.domain.org\",\"computer\"]}}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_zfs-legacy.json b/tests/data/linux_zfs-legacy.json index 45752b7e51f0..d2b750ee0ff5 100644 --- a/tests/data/linux_zfs-legacy.json +++ b/tests/data/linux_zfs-legacy.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"pools\":[\"arc\"],\"health\":1,\"l2_errors\":null}" + "data": "{\"pools\":[\"arc\"],\"health\":1,\"l2_errors\":null}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_zfs-v1-compressed.json b/tests/data/linux_zfs-v1-compressed.json index 5051459d5685..05a9dea6d35b 100644 --- a/tests/data/linux_zfs-v1-compressed.json +++ b/tests/data/linux_zfs-v1-compressed.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"pools\":[\"arc\"],\"health\":1,\"l2_errors\":null}" + "data": "{\"pools\":[\"arc\"],\"health\":1,\"l2_errors\":null}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_zfs-v1.json b/tests/data/linux_zfs-v1.json index 45752b7e51f0..d2b750ee0ff5 100644 --- a/tests/data/linux_zfs-v1.json +++ b/tests/data/linux_zfs-v1.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"pools\":[\"arc\"],\"health\":1,\"l2_errors\":null}" + "data": "{\"pools\":[\"arc\"],\"health\":1,\"l2_errors\":null}", + "deleted_at": null } ], "application_metrics": [ diff --git a/tests/data/linux_zfs-v3.json b/tests/data/linux_zfs-v3.json index c01709f7212e..93a35872c228 100644 --- a/tests/data/linux_zfs-v3.json +++ b/tests/data/linux_zfs-v3.json @@ -9,7 +9,8 @@ "app_state_prev": null, "app_status": "", "app_instance": "", - "data": null + "data": null, + "deleted_at": null } ] }, @@ -22,7 +23,8 @@ "app_state_prev": "UNKNOWN", "app_status": "", "app_instance": "", - "data": "{\"pools\":[\"arc\"],\"health\":1,\"l2_errors\":0}" + "data": "{\"pools\":[\"arc\"],\"health\":1,\"l2_errors\":0}", + "deleted_at": null } ], "application_metrics": [