| 1 | package as400 |
| 2 | |
| 3 | import ( |
| 4 | "github.com/netdata/netdata/go/plugins/pkg/confopt" |
| 5 | "github.com/netdata/netdata/go/plugins/plugin/ibm.d/framework" |
| 6 | ) |
| 7 | |
| 8 | // Config defines the user-facing configuration for the AS400 collector. |
| 9 | type Config struct { |
| 10 | framework.Config `yaml:",inline" json:",inline"` |
| 11 | |
| 12 | // Vnode allows binding the collector to a virtual node. |
| 13 | Vnode string `yaml:"vnode,omitempty" json:"vnode" ui:"group:Connection"` |
| 14 | |
| 15 | // DSN provides a full IBM i ODBC connection string if manual override is needed. |
| 16 | DSN string `yaml:"dsn" json:"dsn" ui:"group:Connection"` |
| 17 | |
| 18 | // Timeout controls how long to wait for SQL statements and RPCs. |
| 19 | Timeout confopt.Duration `yaml:"timeout,omitempty" json:"timeout" ui:"group:Connection"` |
| 20 | |
| 21 | // Hostname is the remote IBM i host to monitor. |
| 22 | Hostname string `yaml:"hostname,omitempty" json:"hostname" ui:"group:Connection"` |
| 23 | |
| 24 | // Port is the TCP port for the IBM i Access ODBC server. |
| 25 | Port int `yaml:"port,omitempty" json:"port" ui:"group:Connection"` |
| 26 | |
| 27 | // Username supplies the credentials used for authentication. |
| 28 | Username string `yaml:"username,omitempty" json:"username" ui:"group:Connection"` |
| 29 | |
| 30 | // Password supplies the password used for authentication. |
| 31 | Password string `yaml:"password,omitempty" json:"password" ui:"group:Connection"` |
| 32 | |
| 33 | // Database selects the IBM i database (library) to use when building the DSN. |
| 34 | Database string `yaml:"database,omitempty" json:"database" ui:"group:Connection"` |
| 35 | |
| 36 | // ConnectionType selects how the collector connects (currently only "odbc"). |
| 37 | ConnectionType string `yaml:"connection_type,omitempty" json:"connection_type" ui:"group:Connection"` |
| 38 | |
| 39 | // ODBCDriver specifies the driver name registered on the host. |
| 40 | ODBCDriver string `yaml:"odbc_driver,omitempty" json:"odbc_driver" ui:"group:Connection"` |
| 41 | |
| 42 | // UseSSL enables TLS for the ODBC connection when supported by the driver. |
| 43 | UseSSL bool `yaml:"use_ssl,omitempty" json:"use_ssl" ui:"group:Connection"` |
| 44 | |
| 45 | // ResetStatistics toggles destructive SQL services that reset system statistics on each query. |
| 46 | ResetStatistics bool `yaml:"reset_statistics,omitempty" json:"reset_statistics" ui:"group:Advanced"` |
| 47 | |
| 48 | // CollectDiskMetrics toggles collection of disk unit statistics. |
| 49 | CollectDiskMetrics confopt.AutoBool `yaml:"collect_disk_metrics,omitempty" json:"collect_disk_metrics" ui:"group:Disks"` |
| 50 | |
| 51 | // CollectSubsystemMetrics toggles collection of subsystem activity metrics. |
| 52 | CollectSubsystemMetrics confopt.AutoBool `yaml:"collect_subsystem_metrics,omitempty" json:"collect_subsystem_metrics" ui:"group:Subsystems"` |
| 53 | |
| 54 | // CollectActiveJobs toggles collection of detailed per-job metrics. |
| 55 | CollectActiveJobs confopt.AutoBool `yaml:"collect_active_jobs,omitempty" json:"collect_active_jobs" ui:"group:Active Jobs"` |
| 56 | |
| 57 | // CollectHTTPServerMetrics toggles collection of IBM HTTP Server statistics. |
| 58 | CollectHTTPServerMetrics confopt.AutoBool `yaml:"collect_http_server_metrics,omitempty" json:"collect_http_server_metrics" ui:"group:Other Metrics"` |
| 59 | |
| 60 | // CollectPlanCacheMetrics toggles collection of plan cache analysis metrics. |
| 61 | CollectPlanCacheMetrics confopt.AutoBool `yaml:"collect_plan_cache_metrics,omitempty" json:"collect_plan_cache_metrics" ui:"group:Other Metrics"` |
| 62 | |
| 63 | // CollectMessageQueueTotals enables expensive aggregate counting across all message queues. |
| 64 | CollectMessageQueueTotals confopt.AutoBool `yaml:"collect_message_queue_totals,omitempty" json:"collect_message_queue_totals" ui:"group:Queues"` |
| 65 | |
| 66 | // CollectJobQueueTotals enables expensive aggregate counting across all job queues. |
| 67 | CollectJobQueueTotals confopt.AutoBool `yaml:"collect_job_queue_totals,omitempty" json:"collect_job_queue_totals" ui:"group:Queues"` |
| 68 | |
| 69 | // CollectOutputQueueTotals enables expensive aggregate counting across all output queues. |
| 70 | CollectOutputQueueTotals confopt.AutoBool `yaml:"collect_output_queue_totals,omitempty" json:"collect_output_queue_totals" ui:"group:Queues"` |
| 71 | |
| 72 | // SlowPath enables the asynchronous slow-path worker for heavy queries. |
| 73 | SlowPath bool `yaml:"slow_path,omitempty" json:"slow_path" ui:"group:Advanced"` |
| 74 | |
| 75 | // SlowPathUpdateEvery controls the beat interval for the slow-path worker. |
| 76 | SlowPathUpdateEvery confopt.Duration `yaml:"slow_path_update_every,omitempty" json:"slow_path_update_every" ui:"group:Advanced"` |
| 77 | |
| 78 | // SlowPathMaxConnections caps the number of concurrent queries the slow-path worker may run. |
| 79 | SlowPathMaxConnections int `yaml:"slow_path_max_connections,omitempty" json:"slow_path_max_connections" ui:"group:Advanced"` |
| 80 | |
| 81 | // BatchPath enables the long-period batch worker for expensive queue aggregates. |
| 82 | BatchPath bool `yaml:"batch_path,omitempty" json:"batch_path" ui:"group:Advanced"` |
| 83 | |
| 84 | // BatchPathUpdateEvery controls the beat interval for the batch worker. |
| 85 | BatchPathUpdateEvery confopt.Duration `yaml:"batch_path_update_every,omitempty" json:"batch_path_update_every" ui:"group:Advanced"` |
| 86 | |
| 87 | // BatchPathMaxConnections caps concurrent queries for the batch worker. |
| 88 | BatchPathMaxConnections int `yaml:"batch_path_max_connections,omitempty" json:"batch_path_max_connections" ui:"group:Advanced"` |
| 89 | |
| 90 | // MaxDisks caps how many disk units may be charted. |
| 91 | MaxDisks int `yaml:"max_disks,omitempty" json:"max_disks" ui:"group:Disks"` |
| 92 | |
| 93 | // MaxSubsystems caps how many subsystems may be charted. |
| 94 | MaxSubsystems int `yaml:"max_subsystems,omitempty" json:"max_subsystems" ui:"group:Subsystems"` |
| 95 | |
| 96 | // DiskSelector filters disk units by name using glob-style patterns. |
| 97 | DiskSelector string `yaml:"collect_disks_matching,omitempty" json:"collect_disks_matching" ui:"group:Disks"` |
| 98 | |
| 99 | // SubsystemSelector filters subsystems by name using glob-style patterns. |
| 100 | SubsystemSelector string `yaml:"collect_subsystems_matching,omitempty" json:"collect_subsystems_matching" ui:"group:Subsystems"` |
| 101 | |
| 102 | // ActiveJobs lists active jobs to monitor, using fully-qualified job identifiers (JOB_NUMBER/USER/JOB_NAME). |
| 103 | // When empty, active job collection is disabled. |
| 104 | ActiveJobs []string `yaml:"active_jobs,omitempty" json:"active_jobs" ui:"group:Active Jobs"` |
| 105 | |
| 106 | // MessageQueues lists message queues to collect, formatted as LIBRARY/QUEUE strings. |
| 107 | // When empty, message queue collection is disabled. The default configuration monitors |
| 108 | // QSYS/QSYSOPR, QSYS/QSYSMSG, and QSYS/QHST. |
| 109 | MessageQueues []string `yaml:"message_queues,omitempty" json:"message_queues" ui:"group:Queues"` |
| 110 | |
| 111 | // JobQueues lists job queues to collect, formatted as LIBRARY/QUEUE strings. |
| 112 | // When empty, job queue collection is disabled. |
| 113 | JobQueues []string `yaml:"job_queues,omitempty" json:"job_queues" ui:"group:Queues"` |
| 114 | |
| 115 | // OutputQueues lists output queues to collect, formatted as LIBRARY/QUEUE strings. |
| 116 | // When empty, output queue collection is disabled. |
| 117 | OutputQueues []string `yaml:"output_queues,omitempty" json:"output_queues" ui:"group:Queues"` |
| 118 | } |