Commit Graph

27 Commits

Author SHA1 Message Date
Jason Kulatunga f2856e0f26 adding a healthcheck endpoint that confirms communication with influxdb and sqlite.
ref: #381
2022-11-30 08:25:27 -08:00
Jason Kulatunga f823127825 simplify logger creation (move logic into a function in main packages)
Ensure logger creation is consistent between Web and Collector
Create logger in main, pass down to downstream functions (like gin)
In debug mode, print a copy of AppConfig
Better debugging for logger.
2022-08-03 22:51:44 -07:00
Jason Kulatunga 94594db20a on settings save, return the new settings.
update the frontend to persist settings to the database.
Using ScrutinyConfigService instead of TreoConfigService.
Using snake case settings in frontend.
Make sure we're using AppConfig type where possible.
2022-07-23 14:36:32 -07:00
Jason Kulatunga 7e672e8b8e adding tests for config.MergeConfigMap functionality. (Set vs SetDefault).
Converted all settings keys to snakecase.
2022-07-23 10:19:15 -07:00
Jason Kulatunga 54e2cacb00 move frontend settings into the DB (for consistent settings handling).
Flattened settings object.
2022-07-23 09:32:56 -07:00
Jason Kulatunga 29bc79996b working settings update.
Settings are loaded from the DB and added to the AppConfig during startup.
When updating settings, they are stored in AppConfig, and written do  the database.
2022-07-19 23:12:23 -07:00
Jason Kulatunga 99af2b8b16 WIP settings system.
- updated dbdiagrams schema
- [BREAKING] force failure if `notify.filter_attributes` or `notify.level` is set
- added Settings table (and default values during migration)
- Added Save Settings and Get Settings functions.
- Added web API endpoints for getting and saving settings.
- Deprecated old Notify* constants. Created new MetricsStatus* and MetricsNotifyLevel constants.
2022-07-17 10:32:28 -07:00
Jason Kulatunga 5ea149d878 upgrading to go 1.18 for generics (and lodash-like library).
devices with an empty wwn should be filtered out (not uploaded during device registration, skipped when attempting to upload metrics).
added a migration to delete existing device entries with an empty `wwn`

fixes #314
2022-07-09 18:28:49 -07:00
Jason Kulatunga b71d6660a6 adding typescript interfaces for type hinting and testing
some code reformatting
adding tests for services and components.
cleanup of unused dependencies in components.
refactor dashboard service so that wrapper is removed before data is passed to component. (no more this.data.data...).
refactored components so that variable names are consistent (dashboardService vs smartService).
ensure argument and return types are specified everywhere.
adding tests for pipes.

adding ng test to ci steps.

change dir before running npm install.

trying to install nodejs in continer.

test frontend separately.

upload coverage for frontend and backend.

upload coverage for frontend and backend.

testing coverage file locations.

retry file upload.
2022-07-08 22:21:06 -07:00
Jason Kulatunga 7babc280a0 ensure that users can filter their notifications by:
- failing attribute type (Critical vs All)
 - failure reason (Smart, Scrutiny, Both)

 fixes #300
2022-06-20 08:15:06 -07:00
Jason Kulatunga 1bd86f5abd [WIP] Delete button for devices. 2022-05-25 14:59:55 -07:00
Jason Kulatunga fabc629e40 handle case where WWN not detected for a device (print error messages, but skip device collection & uploading). 2022-05-05 23:03:06 -07:00
Jason Kulatunga 0a9d364aea adding duration key to smart attributes api endpoint 2022-04-29 15:26:15 -07:00
Jason Kulatunga 03bfdd3890 changing the duration dropdown for temp history data. adding an /api/summary/temp endpoint 2021-11-16 20:39:09 -08:00
Jason Kulatunga 80f4660130 validate thresholds whenever SMART data is recieved. 2021-07-25 22:11:07 -07:00
Jason Kulatunga 8a46931399 !!!!WIP!!!!
adding InfluxDB

- influxdb added to dockerfile
- influxdb s6 service
- influxdb config
- adding defaults to config
- creating a DeviceRepo interface (multiple db backends)
- implemented DeviceRepo interface as ScruitnyRepository
2021-06-27 10:55:18 -07:00
Jason Kulatunga 9fac3c6308 fix gorm dependency. 2020-10-07 22:07:51 -06:00
Jason Kulatunga 1cd5ebaa43 missing device type update. 2020-10-07 21:59:48 -06:00
Jason Kulatunga b44ef5cb9c adding support for a collecto config file.
/scrutiny/config/collector.yaml

Adding ability to specify host identifier (label), that is updated on every collector run.
Can be specified by `host-id` CLI or `COLLECTOR_HOST_ID` env var.

Created a config class, interface and associated tests.

Created a "TransformDetectedDrives" function, that will allow users to insert drives not detected by Smarctl --scan, ignore drives that they dont want, and override smartctl device type.

Added Upsert functionality when registering devices.

Replaced "github.com/jinzhu/gorm" with "gorm.io/gorm" (ORM location moved, was using incorrect lib url)
Removed machineid library.
2020-10-07 21:54:29 -06:00
Jason Kulatunga a3438297e6 removeedd waitgroup, using sync/errgroup instead (to pass error messages back). returning errors in test notifications endpoint payload. Adding failure tests for webhooks, scripts & shoutrr. 2020-10-03 10:40:27 -06:00
Jason Kulatunga d339e967a6 fixing notifications. 2020-10-02 21:05:04 -06:00
Jason Kulatunga 6377a258f6 sending notifications on failure. 2020-10-01 18:59:08 -06:00
Jason Kulatunga 6a20228262 adding error handling for all DB calls. Returning StatusInternalServerError whenever an error occurs. Adding additional logging to server handlers.
Make sure we "return" after a c.JSON call.
2020-09-23 09:54:33 -06:00
Jason Kulatunga 78a619b09d moved middleware into more relevant location. Adding send test notifications handler. making sure that config is available from web handler functions. 2020-09-18 10:13:06 -06:00
Jason Kulatunga e283d43654 rename metadata class names.
adding metadata for NVME and SCSI drives.
send back protocol specific metadata for displaying data in the UI for attributes.
UI - moved all metadata lookups into named functions (for better if/else logic)
show different columns if nvme or scsi.
2020-08-28 00:41:08 -07:00
Jason Kulatunga 5a80ae3e74 WIP - start supporting NVME and SCSI drive smart data.
Added addiitonal log message data for Smartctl exit ccode.
2020-08-24 23:01:03 -07:00
Jason Kulatunga d636709aa1 Moved version file into webapp source tree. Replacing fmt with logger calls. moved Jobber config file into /scrutiny/jobber directory. Added scsi json file. Moved API rooute handlers into their own files in a module. Added not yet implemnented tooltips. 2020-08-21 18:06:00 -07:00