summaryrefslogtreecommitdiffstats
path: root/drivers/atm/idt77105.h
blob: 8dfea9e361de266fb2061442c62249a1b562cf1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* SPDX-License-Identifier: GPL-2.0 */
/* drivers/atm/idt77105.h - IDT77105 (PHY) declarations */
 
/* Written 1999 by Greg Banks, NEC Australia <gnb@linuxfan.com>. Based on suni.h */
 

#ifndef DRIVER_ATM_IDT77105_H
#define DRIVER_ATM_IDT77105_H

#include <linux/atmdev.h>
#include <linux/atmioc.h>


/* IDT77105 registers */

#define IDT77105_MCR		0x0	/* Master Control Register */
#define IDT77105_ISTAT	        0x1	/* Interrupt Status */
#define IDT77105_DIAG   	0x2	/* Diagnostic Control */
#define IDT77105_LEDHEC		0x3	/* LED Driver & HEC Status/Control */
#define IDT77105_CTRLO		0x4	/* Low Byte Counter Register */
#define IDT77105_CTRHI		0x5	/* High Byte Counter Register */
#define IDT77105_CTRSEL		0x6	/* Counter Register Read Select */

/* IDT77105 register values */

/* MCR */
#define IDT77105_MCR_UPLO	0x80	/* R/W, User Prog'le Output Latch */
#define IDT77105_MCR_DREC	0x40	/* R/W, Discard Receive Error Cells */
#define IDT77105_MCR_ECEIO	0x20	/* R/W, Enable Cell Error Interrupts
                                         * Only */
#define IDT77105_MCR_TDPC	0x10	/* R/W, Transmit Data Parity Check */
#define IDT77105_MCR_DRIC	0x08	/* R/W, Discard Received Idle Cells */
#define IDT77105_MCR_HALTTX	0x04	/* R/W, Halt Tx */
#define IDT77105_MCR_UMODE	0x02	/* R/W, Utopia (cell/byte) Mode */
#define IDT77105_MCR_EIP	0x01	/* R/W, Enable Interrupt Pin */

/* ISTAT */
#define IDT77105_ISTAT_GOODSIG	0x40	/* R, Good Signal Bit */
#define IDT77105_ISTAT_HECERR	0x20	/* sticky, HEC Error*/
#define IDT77105_ISTAT_SCR	0x10	/* sticky, Short Cell Received */
#define IDT77105_ISTAT_TPE	0x08	/* sticky, Transmit Parity Error */
#define IDT77105_ISTAT_RSCC	0x04	/* sticky, Rx Signal Condition Change */
#define IDT77105_ISTAT_RSE	0x02	/* sticky, Rx Symbol Error */
#define IDT77105_ISTAT_RFO	0x01	/* sticky, Rx FIFO Overrun */

/* DIAG */
#define IDT77105_DIAG_FTD	0x80	/* R/W, Force TxClav deassert */
#define IDT77105_DIAG_ROS	0x40	/* R/W, RxClav operation select */
#define IDT77105_DIAG_MPCS	0x20	/* R/W, Multi-PHY config'n select */
#define IDT77105_DIAG_RFLUSH	0x10	/* R/W, clear receive FIFO */
#define IDT77105_DIAG_ITPE	0x08	/* R/W, Insert Tx payload error */
#define IDT77105_DIAG_ITHE	0x04	/* R/W, Insert Tx HEC error */
#define IDT77105_DIAG_UMODE	0x02	/* R/W, Utopia (cell/byte) Mode */
#define IDT77105_DIAG_LCMASK	0x03	/* R/W, Loopback Control */

#define IDT77105_DIAG_LC_NORMAL         0x00	/* Receive from network */
#define IDT77105_DIAG_LC_PHY_LOOPBACK	0x02
#define IDT77105_DIAG_LC_LINE_LOOPBACK	0x03

/* LEDHEC */
#define IDT77105_LEDHEC_DRHC	0x40	/* R/W, Disable Rx HEC check */
#define IDT77105_LEDHEC_DTHC	0x20	/* R/W, Disable Tx HEC calculation */
#define IDT77105_LEDHEC_RPWMASK	0x18	/* R/W, RxRef pulse width select */
#define IDT77105_LEDHEC_TFS	0x04	/* R, Tx FIFO Status (1=empty) */
#define IDT77105_LEDHEC_TLS	0x02	/* R, Tx LED Status (1=lit) */
#define IDT77105_LEDHEC_RLS	0x01	/* R, Rx LED Status (1=lit) */

#define IDT77105_LEDHEC_RPW_1	0x00	/* RxRef active for 1 RxClk cycle */
#define IDT77105_LEDHEC_RPW_2	0x08	/* RxRef active for 2 RxClk cycle */
#define IDT77105_LEDHEC_RPW_4	0x10	/* RxRef active for 4 RxClk cycle */
#define IDT77105_LEDHEC_RPW_8	0x18	/* RxRef active for 8 RxClk cycle */

/* CTRSEL */
#define IDT77105_CTRSEL_SEC	0x08	/* W, Symbol Error Counter */
#define IDT77105_CTRSEL_TCC	0x04	/* W, Tx Cell Counter */
#define IDT77105_CTRSEL_RCC	0x02	/* W, Rx Cell Counter */
#define IDT77105_CTRSEL_RHEC	0x01	/* W, Rx HEC Error Counter */

#ifdef __KERNEL__
int idt77105_init(struct atm_dev *dev);
#endif

/*
 * Tunable parameters
 */
 
/* Time between samples of the hardware cell counters. Should be <= 1 sec */
#define IDT77105_STATS_TIMER_PERIOD     (HZ) 
/* Time between checks to see if the signal has been found again */
#define IDT77105_RESTART_TIMER_PERIOD   (5 * HZ)

#endif
ub.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS communication link is lost |\n",
- "metrics": "## Metrics\n\nMetrics grouped by *scope*.\n\nThe scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.\n\n\n\n### Per ups\n\nMetrics related to UPS. Each UPS provides its own set of the following metrics.\n\nThis scope has no labels.\n\nMetrics:\n\n| Metric | Dimensions | Unit |\n|:------|:----------|:----|\n| apcupsd.charge | charge | percentage |\n| apcupsd.battery.voltage | voltage, nominal | Volts |\n| apcupsd.input.voltage | voltage, min, max | Volts |\n| apcupsd.output.voltage | absolute, nominal | Volts |\n| apcupsd.input.frequency | frequency | Hz |\n| apcupsd.load | load | percentage |\n| apcupsd.load_usage | load | Watts |\n| apcupsd.temperature | temp | Celsius |\n| apcupsd.time | time | Minutes |\n| apcupsd.online | online | boolean |\n| apcupsd.selftest | OK, NO, BT, NG | status |\n| apcupsd.status | ONLINE, ONBATT, OVERLOAD, LOWBATT, REPLACEBATT, NOBATT, SLAVE, SLAVEDOWN, COMMLOST, CAL, TRIM, BOOST, SHUTTING_DOWN | status |\n\n",
- "integration_type": "collector",
- "id": "charts.d.plugin-apcupsd-APC_UPS",
- "edit_link": "https://github.com/netdata/netdata/blob/master/src/collectors/charts.d.plugin/apcupsd/metadata.yaml",
- "related_resources": ""
- },
- {
- "meta": {
- "plugin_name": "charts.d.plugin",
"module_name": "libreswan",
"monitored_instance": {
"name": "Libreswan",
@@ -3293,6 +3253,44 @@ export const integrations = [
},
{
"meta": {
+ "id": "collector-go.d.plugin-apcupsd",
+ "plugin_name": "go.d.plugin",
+ "module_name": "apcupsd",
+ "monitored_instance": {
+ "name": "APC UPS",
+ "link": "https://www.apc.com",
+ "icon_filename": "apc.svg",
+ "categories": [
+ "data-collection.ups"
+ ]
+ },
+ "keywords": [
+ "ups",
+ "apcupsd",
+ "apc"
+ ],
+ "related_resources": {
+ "integrations": {
+ "list": []
+ }
+ },
+ "info_provided_to_referring_integrations": {
+ "description": ""
+ },
+ "most_popular": false
+ },
+ "overview": "# APC UPS\n\nPlugin: go.d.plugin\nModule: apcupsd\n\n## Overview\n\nThis collector monitors Uninterruptible Power Supplies by polling the Apcupsd daemon.\n\n\n\n\nThis collector is supported on all platforms.\n\nThis collector supports collecting metrics from multiple instances of this integration, including remote instances.\n\n\n### Default Behavior\n\n#### Auto-Detection\n\nBy default, it detects Apcupsd instances running on localhost that are listening on port 3551.\nOn startup, it tries to collect metrics from:\n\n- 127.0.0.1:3551\n\n\n#### Limits\n\nThe default configuration for this integration does not impose any limits on data collection.\n\n#### Performance Impact\n\nThe default configuration for this integration is not expected to impose a significant performance impact on the system.\n",
+ "setup": "## Setup\n\n### Prerequisites\n\nNo action required.\n\n### Configuration\n\n#### File\n\nThe configuration file name for this integration is `go.d/apcupsd.conf`.\n\n\nYou can edit the configuration file using the `edit-config` script from the\nNetdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory).\n\n```bash\ncd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata\nsudo ./edit-config go.d/apcupsd.conf\n```\n#### Options\n\nThe following options can be defined globally: update_every, autodetection_retry.\n\n\n{% details open=true summary=\"Config options\" %}\n| Name | Description | Default | Required |\n|:----|:-----------|:-------|:--------:|\n| update_every | Data collection frequency. | 1 | no |\n| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no |\n| address | Apcupsd daemon address in IP:PORT format. | 127.0.0.1:3551 | yes |\n| timeout | Connection/read/write timeout in seconds. The timeout includes name resolution, if required. | 2 | no |\n\n{% /details %}\n#### Examples\n\n##### Basic\n\nA basic example configuration.\n\n{% details open=true summary=\"Config\" %}\n```yaml\njobs:\n - name: local\n address: 127.0.0.1:3551\n\n```\n{% /details %}\n##### Multi-instance\n\n> **Note**: When you define multiple jobs, their names must be unique.\n\nCollecting metrics from local and remote instances.\n\n\n{% details open=true summary=\"Config\" %}\n```yaml\njobs:\n - name: local\n address: 127.0.0.1:3551\n\n - name: remote\n address: 203.0.113.0:3551\n\n```\n{% /details %}\n",
+ "troubleshooting": "## Troubleshooting\n\n### Debug Mode\n\n**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature.\n\nTo troubleshoot issues with the `apcupsd` collector, run the `go.d.plugin` with the debug option enabled. The output\nshould give you clues as to why the collector isn't working.\n\n- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on\n your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.\n\n ```bash\n cd /usr/libexec/netdata/plugins.d/\n ```\n\n- Switch to the `netdata` user.\n\n ```bash\n sudo -u netdata -s\n ```\n\n- Run the `go.d.plugin` to debug the collector:\n\n ```bash\n ./go.d.plugin -d -m apcupsd\n ```\n\n### Getting Logs\n\nIf you're encountering problems with the `apcupsd` collector, follow these steps to retrieve logs and identify potential issues:\n\n- **Run the command** specific to your system (systemd, non-systemd, or Docker container).\n- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem.\n\n#### System with systemd\n\nUse the following command to view logs generated since the last Netdata service restart:\n\n```bash\njournalctl _SYSTEMD_INVOCATION_ID=\"$(systemctl show --value --property=InvocationID netdata)\" --namespace=netdata --grep apcupsd\n```\n\n#### System without systemd\n\nLocate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name:\n\n```bash\ngrep apcupsd /var/log/netdata/collector.log\n```\n\n**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues.\n\n#### Docker Container\n\nIf your Netdata runs in a Docker container named \"netdata\" (replace if different), use this command:\n\n```bash\ndocker logs netdata 2>&1 | grep apcupsd\n```\n\n",
+ "alerts": "## Alerts\n\n\nThe following alerts are available:\n\n| Alert name | On metric | Description |\n|:------------|:----------|:------------|\n| [ apcupsd_ups_load_capacity ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_load_capacity_utilization | APC UPS average load over the last 10 minutes |\n| [ apcupsd_ups_battery_charge ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_battery_charge | APC UPS average battery charge over the last minute |\n| [ apcupsd_last_collected_secs ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS number of seconds since the last successful data collection |\n| [ apcupsd_ups_selftest_warning ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_selftest | APC UPS self-test failed due to insufficient battery capacity or due to overload |\n| [ apcupsd_ups_status_onbatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS has switched to battery power because the input power has failed |\n| [ apcupsd_ups_status_overload ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS is overloaded and cannot supply enough power to the load |\n| [ apcupsd_ups_status_lowbatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS battery is low and needs to be recharged |\n| [ apcupsd_ups_status_replacebatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS battery has reached the end of its lifespan and needs to be replaced |\n| [ apcupsd_ups_status_nobatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS has no battery |\n| [ apcupsd_ups_status_commlost ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS communication link is lost |\n",
+ "metrics": "## Metrics\n\nMetrics grouped by *scope*.\n\nThe scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.\n\n\n\n### Per ups\n\nThese metrics refer to the UPS unit.\n\nThis scope has no labels.\n\nMetrics:\n\n| Metric | Dimensions | Unit |\n|:------|:----------|:----|\n| apcupsd.ups_status | TRIM, BOOST, CAL, ONLINE, ONBATT, OVERLOAD, LOWBATT, REPLACEBATT, NOBATT, SLAVE, SLAVEDOWN, COMMLOST, SHUTTING_DOWN | status |\n| apcupsd.ups_selftest | NO, NG, WN, IP, OK, BT, UNK | status |\n| apcupsd.ups_battery_charge | charge | percent |\n| apcupsd.ups_battery_time_remaining | timeleft | seconds |\n| apcupsd.ups_battery_time_since_replacement | since_replacement | seconds |\n| apcupsd.ups_battery_voltage | voltage, nominal_voltage | Volts |\n| apcupsd.ups_load_capacity_utilization | load | percent |\n| apcupsd.ups_load | load | Watts |\n| apcupsd.ups_temperature | temperature | Celsius |\n| apcupsd.ups_input_voltage | voltage, min_voltage, max_voltage | Volts |\n| apcupsd.ups_input_frequency | frequency | Hz |\n| apcupsd.ups_output_voltage | voltage | Volts |\n\n",
+ "integration_type": "collector",
+ "id": "go.d.plugin-apcupsd-APC_UPS",
+ "edit_link": "https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/modules/apcupsd/metadata.yaml",
+ "related_resources": ""
+ },
+ {
+ "meta": {
"id": "collector-go.d.plugin-beanstalk",
"plugin_name": "go.d.plugin",
"module_name": "beanstalk",
diff --git a/integrations/integrations.json b/integrations/integrations.json
index 4791b4a6f0..575117437c 100644
--- a/integrations/integrations.json
+++ b/integrations/integrations.json
@@ -1014,46 +1014,6 @@
{
"meta": {
"plugin_name": "charts.d.plugin",
- "module_name": "apcupsd",
- "monitored_instance": {
- "name": "APC UPS",
- "link": "https://www.apc.com",
- "categories": [
- "data-collection.ups"
- ],
- "icon_filename": "apc.svg"
- },
- "related_resources": {
- "integrations": {
- "list": []
- }
- },
- "info_provided_to_referring_integrations": {
- "description": ""
- },
- "keywords": [
- "ups",
- "apc",
- "power",
- "supply",
- "battery",
- "apcupsd"
- ],
- "most_popular": false
- },
- "overview": "# APC UPS\n\nPlugin: charts.d.plugin\nModule: apcupsd\n\n## Overview\n\nMonitor APC UPS performance with Netdata for optimal uninterruptible power supply operations. Enhance your power supply reliability with real-time APC UPS metrics.\n\nThe collector uses the `apcaccess` tool to contact the `apcupsd` daemon and get the APC UPS statistics.\n\nThis collector is supported on all platforms.\n\nThis collector only supports collecting metrics from a single instance of this integration.\n\n\n### Default Behavior\n\n#### Auto-Detection\n\nBy default, with no configuration provided, the collector will try to contact 127.0.0.1:3551 with using the `apcaccess` utility.\n\n#### Limits\n\nThe default configuration for this integration does not impose any limits on data collection.\n\n#### Performance Impact\n\nThe default configuration for this integration is not expected to impose a significant performance impact on the system.\n",
- "setup": "## Setup\n\n### Prerequisites\n\n#### Install charts.d plugin\n\nIf [using our official native DEB/RPM packages](/packaging/installer/UPDATE.md#determine-which-installation-method-you-used), make sure `netdata-plugin-chartsd` is installed.\n\n\n#### Required software\n\nMake sure the `apcaccess` and `apcupsd` are installed and running.\n\n\n### Configuration\n\n#### File\n\nThe configuration file name for this integration is `charts.d/apcupsd.conf`.\n\n\nYou can edit the configuration file using the `edit-config` script from the\nNetdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory).\n\n```bash\ncd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata\nsudo ./edit-config charts.d/apcupsd.conf\n```\n#### Options\n\nThe config file is sourced by the charts.d plugin. It's a standard bash file.\n\nThe following collapsed table contains all the options that can be configured for the apcupsd collector.\n\n\n| Name | Description | Default | Required |\n|:----|:-----------|:-------|:--------:|\n| apcupsd_sources | This is an array of apcupsd sources. You can have multiple entries there. Please refer to the example below on how to set it. | 127.0.0.1:3551 | no |\n| apcupsd_timeout | How long to wait for apcupsd to respond. | 3 | no |\n| apcupsd_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 1 | no |\n| apcupsd_priority | The charts priority on the dashboard. | 90000 | no |\n| apcupsd_retries | The number of retries to do in case of failure before disabling the collector. | 10 | no |\n\n#### Examples\n\n##### Multiple apcupsd sources\n\nSpecify a multiple apcupsd sources along with a custom update interval\n\n```yaml\n# add all your APC UPSes in this array - uncomment it too\ndeclare -A apcupsd_sources=(\n [\"local\"]=\"127.0.0.1:3551\",\n [\"remote\"]=\"1.2.3.4:3551\"\n)\n\n# how long to wait for apcupsd to respond\n#apcupsd_timeout=3\n\n# the data collection frequency\n# if unset, will inherit the netdata update frequency\napcupsd_update_every=5\n\n# the charts priority on the dashboard\n#apcupsd_priority=90000\n\n# the number of retries to do in case of failure\n# before disabling the module\n#apcupsd_retries=10\n\n```\n",
- "troubleshooting": "## Troubleshooting\n\n### Debug Mode\n\n\nTo troubleshoot issues with the `apcupsd` collector, run the `charts.d.plugin` with the debug option enabled. The output\nshould give you clues as to why the collector isn't working.\n\n- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on\n your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.\n\n ```bash\n cd /usr/libexec/netdata/plugins.d/\n ```\n\n- Switch to the `netdata` user.\n\n ```bash\n sudo -u netdata -s\n ```\n\n- Run the `charts.d.plugin` to debug the collector:\n\n ```bash\n ./charts.d.plugin debug 1 apcupsd\n ```\n\n### Getting Logs\n\nIf you're encountering problems with the `apcupsd` collector, follow these steps to retrieve logs and identify potential issues:\n\n- **Run the command** specific to your system (systemd, non-systemd, or Docker container).\n- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem.\n\n#### System with systemd\n\nUse the following command to view logs generated since the last Netdata service restart:\n\n```bash\njournalctl _SYSTEMD_INVOCATION_ID=\"$(systemctl show --value --property=InvocationID netdata)\" --namespace=netdata --grep apcupsd\n```\n\n#### System without systemd\n\nLocate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name:\n\n```bash\ngrep apcupsd /var/log/netdata/collector.log\n```\n\n**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues.\n\n#### Docker Container\n\nIf your Netdata runs in a Docker container named \"netdata\" (replace if different), use this command:\n\n```bash\ndocker logs netdata 2>&1 | grep apcupsd\n```\n\n",
- "alerts": "## Alerts\n\n\nThe following alerts are available:\n\n| Alert name | On metric | Description |\n|:------------|:----------|:------------|\n| [ apcupsd_ups_charge ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.charge | average UPS charge over the last minute |\n| [ apcupsd_10min_ups_load ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.load | average UPS load over the last 10 minutes |\n| [ apcupsd_last_collected_secs ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.load | number of seconds since the last successful data collection |\n| [ apcupsd_selftest_warning ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.selftest | self-test failed due to insufficient battery capacity or due to overload. |\n| [ apcupsd_status_onbatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS has switched to battery power because the input power has failed |\n| [ apcupsd_status_overload ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS is overloaded and cannot supply enough power to the load |\n| [ apcupsd_status_lowbatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS battery is low and needs to be recharged |\n| [ apcupsd_status_replacebatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS battery has reached the end of its lifespan and needs to be replaced |\n| [ apcupsd_status_nobatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS has no battery |\n| [ apcupsd_status_commlost ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS communication link is lost |\n",
- "metrics": "## Metrics\n\nMetrics grouped by *scope*.\n\nThe scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.\n\n\n\n### Per ups\n\nMetrics related to UPS. Each UPS provides its own set of the following metrics.\n\nThis scope has no labels.\n\nMetrics:\n\n| Metric | Dimensions | Unit |\n|:------|:----------|:----|\n| apcupsd.charge | charge | percentage |\n| apcupsd.battery.voltage | voltage, nominal | Volts |\n| apcupsd.input.voltage | voltage, min, max | Volts |\n| apcupsd.output.voltage | absolute, nominal | Volts |\n| apcupsd.input.frequency | frequency | Hz |\n| apcupsd.load | load | percentage |\n| apcupsd.load_usage | load | Watts |\n| apcupsd.temperature | temp | Celsius |\n| apcupsd.time | time | Minutes |\n| apcupsd.online | online | boolean |\n| apcupsd.selftest | OK, NO, BT, NG | status |\n| apcupsd.status | ONLINE, ONBATT, OVERLOAD, LOWBATT, REPLACEBATT, NOBATT, SLAVE, SLAVEDOWN, COMMLOST, CAL, TRIM, BOOST, SHUTTING_DOWN | status |\n\n",
- "integration_type": "collector",
- "id": "charts.d.plugin-apcupsd-APC_UPS",
- "edit_link": "https://github.com/netdata/netdata/blob/master/src/collectors/charts.d.plugin/apcupsd/metadata.yaml",
- "related_resources": ""
- },
- {
- "meta": {
- "plugin_name": "charts.d.plugin",
"module_name": "libreswan",
"monitored_instance": {
"name": "Libreswan",
@@ -3291,6 +3251,44 @@
},
{
"meta": {
+ "id": "collector-go.d.plugin-apcupsd",
+ "plugin_name": "go.d.plugin",
+ "module_name": "apcupsd",
+ "monitored_instance": {
+ "name": "APC UPS",
+ "link": "https://www.apc.com",
+ "icon_filename": "apc.svg",
+ "categories": [
+ "data-collection.ups"
+ ]
+ },
+ "keywords": [
+ "ups",
+ "apcupsd",
+ "apc"
+ ],
+ "related_resources": {
+ "integrations": {
+ "list": []
+ }
+ },
+ "info_provided_to_referring_integrations": {
+ "description": ""
+ },
+ "most_popular": false
+ },
+ "overview": "# APC UPS\n\nPlugin: go.d.plugin\nModule: apcupsd\n\n## Overview\n\nThis collector monitors Uninterruptible Power Supplies by polling the Apcupsd daemon.\n\n\n\n\nThis collector is supported on all platforms.\n\nThis collector supports collecting metrics from multiple instances of this integration, including remote instances.\n\n\n### Default Behavior\n\n#### Auto-Detection\n\nBy default, it detects Apcupsd instances running on localhost that are listening on port 3551.\nOn startup, it tries to collect metrics from:\n\n- 127.0.0.1:3551\n\n\n#### Limits\n\nThe default configuration for this integration does not impose any limits on data collection.\n\n#### Performance Impact\n\nThe default configuration for this integration is not expected to impose a significant performance impact on the system.\n",
+ "setup": "## Setup\n\n### Prerequisites\n\nNo action required.\n\n### Configuration\n\n#### File\n\nThe configuration file name for this integration is `go.d/apcupsd.conf`.\n\n\nYou can edit the configuration file using the `edit-config` script from the\nNetdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory).\n\n```bash\ncd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata\nsudo ./edit-config go.d/apcupsd.conf\n```\n#### Options\n\nThe following options can be defined globally: update_every, autodetection_retry.\n\n\n| Name | Description | Default | Required |\n|:----|:-----------|:-------|:--------:|\n| update_every | Data collection frequency. | 1 | no |\n| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no |\n| address | Apcupsd daemon address in IP:PORT format. | 127.0.0.1:3551 | yes |\n| timeout | Connection/read/write timeout in seconds. The timeout includes name resolution, if required. | 2 | no |\n\n#### Examples\n\n##### Basic\n\nA basic example configuration.\n\n```yaml\njobs:\n - name: local\n address: 127.0.0.1:3551\n\n```\n##### Multi-instance\n\n> **Note**: When you define multiple jobs, their names must be unique.\n\nCollecting metrics from local and remote instances.\n\n\n```yaml\njobs:\n - name: local\n address: 127.0.0.1:3551\n\n - name: remote\n address: 203.0.113.0:3551\n\n```\n",
+ "troubleshooting": "## Troubleshooting\n\n### Debug Mode\n\n**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature.\n\nTo troubleshoot issues with the `apcupsd` collector, run the `go.d.plugin` with the debug option enabled. The output\nshould give you clues as to why the collector isn't working.\n\n- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on\n your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.\n\n ```bash\n cd /usr/libexec/netdata/plugins.d/\n ```\n\n- Switch to the `netdata` user.\n\n ```bash\n sudo -u netdata -s\n ```\n\n- Run the `go.d.plugin` to debug the collector:\n\n ```bash\n ./go.d.plugin -d -m apcupsd\n ```\n\n### Getting Logs\n\nIf you're encountering problems with the `apcupsd` collector, follow these steps to retrieve logs and identify potential issues:\n\n- **Run the command** specific to your system (systemd, non-systemd, or Docker container).\n- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem.\n\n#### System with systemd\n\nUse the following command to view logs generated since the last Netdata service restart:\n\n```bash\njournalctl _SYSTEMD_INVOCATION_ID=\"$(systemctl show --value --property=InvocationID netdata)\" --namespace=netdata --grep apcupsd\n```\n\n#### System without systemd\n\nLocate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name:\n\n```bash\ngrep apcupsd /var/log/netdata/collector.log\n```\n\n**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues.\n\n#### Docker Container\n\nIf your Netdata runs in a Docker container named \"netdata\" (replace if different), use this command:\n\n```bash\ndocker logs netdata 2>&1 | grep apcupsd\n```\n\n",
+ "alerts": "## Alerts\n\n\nThe following alerts are available:\n\n| Alert name | On metric | Description |\n|:------------|:----------|:------------|\n| [ apcupsd_ups_load_capacity ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_load_capacity_utilization | APC UPS average load over the last 10 minutes |\n| [ apcupsd_ups_battery_charge ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_battery_charge | APC UPS average battery charge over the last minute |\n| [ apcupsd_last_collected_secs ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS number of seconds since the last successful data collection |\n| [ apcupsd_ups_selftest_warning ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_selftest | APC UPS self-test failed due to insufficient battery capacity or due to overload |\n| [ apcupsd_ups_status_onbatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS has switched to battery power because the input power has failed |\n| [ apcupsd_ups_status_overload ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS is overloaded and cannot supply enough power to the load |\n| [ apcupsd_ups_status_lowbatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS battery is low and needs to be recharged |\n| [ apcupsd_ups_status_replacebatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS battery has reached the end of its lifespan and needs to be replaced |\n| [ apcupsd_ups_status_nobatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS has no battery |\n| [ apcupsd_ups_status_commlost ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS communication link is lost |\n",
+ "metrics": "## Metrics\n\nMetrics grouped by *scope*.\n\nThe scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.\n\n\n\n### Per ups\n\nThese metrics refer to the UPS unit.\n\nThis scope has no labels.\n\nMetrics:\n\n| Metric | Dimensions | Unit |\n|:------|:----------|:----|\n| apcupsd.ups_status | TRIM, BOOST, CAL, ONLINE, ONBATT, OVERLOAD, LOWBATT, REPLACEBATT, NOBATT, SLAVE, SLAVEDOWN, COMMLOST, SHUTTING_DOWN | status |\n| apcupsd.ups_selftest | NO, NG, WN, IP, OK, BT, UNK | status |\n| apcupsd.ups_battery_charge | charge | percent |\n| apcupsd.ups_battery_time_remaining | timeleft | seconds |\n| apcupsd.ups_battery_time_since_replacement | since_replacement | seconds |\n| apcupsd.ups_battery_voltage | voltage, nominal_voltage | Volts |\n| apcupsd.ups_load_capacity_utilization | load | percent |\n| apcupsd.ups_load | load | Watts |\n| apcupsd.ups_temperature | temperature | Celsius |\n| apcupsd.ups_input_voltage | voltage, min_voltage, max_voltage | Volts |\n| apcupsd.ups_input_frequency | frequency | Hz |\n| apcupsd.ups_output_voltage | voltage | Volts |\n\n",
+ "integration_type": "collector",
+ "id": "go.d.plugin-apcupsd-APC_UPS",
+ "edit_link": "https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/modules/apcupsd/metadata.yaml",
+ "related_resources": ""
+ },
+ {
+ "meta": {
"id": "collector-go.d.plugin-beanstalk",
"plugin_name": "go.d.plugin",
"module_name": "beanstalk",
diff --git a/src/collectors/COLLECTORS.md b/src/collectors/COLLECTORS.md
index 6f2971f5c9..a3ca2e8409 100644
--- a/src/collectors/COLLECTORS.md
+++ b/src/collectors/COLLECTORS.md
@@ -1079,7 +1079,7 @@ If you don't see the app/service you'd like to monitor in this list:
### UPS
-- [APC UPS](https://github.com/netdata/netdata/blob/master/src/collectors/charts.d.plugin/apcupsd/integrations/apc_ups.md)
+- [APC UPS](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/modules/apcupsd/integrations/apc_ups.md)
- [Eaton UPS](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/modules/prometheus/integrations/eaton_ups.md)
diff --git a/src/go/plugin/go.d/modules/apcupsd/README.md b/src/go/plugin/go.d/modules/apcupsd/README.md
new file mode 120000
index 0000000000..fc6681fe61
--- /dev/null
+++ b/src/go/plugin/go.d/modules/apcupsd/README.md
@@ -0,0 +1 @@
+integrations/apc_ups.md \ No newline at end of file
diff --git a/src/go/plugin/go.d/modules/apcupsd/integrations/apc_ups.md b/src/go/plugin/go.d/modules/apcupsd/integrations/apc_ups.md
new file mode 100644
index 0000000000..f08fb0a5a0
--- /dev/null
+++ b/src/go/plugin/go.d/modules/apcupsd/integrations/apc_ups.md
@@ -0,0 +1,240 @@
+<!--startmeta
+custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/apcupsd/README.md"
+meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/apcupsd/metadata.yaml"
+sidebar_label: "APC UPS"
+learn_status: "Published"
+learn_rel_path: "Collecting Metrics/UPS"
+most_popular: False
+message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
+endmeta-->
+
+# APC UPS
+
+
+<img src="https://netdata.cloud/img/apc.svg" width="150"/>
+
+
+Plugin: go.d.plugin
+Module: apcupsd
+
+<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
+
+## Overview
+
+This collector monitors Uninterruptible Power Supplies by polling the Apcupsd daemon.
+
+
+
+
+This collector is supported on all platforms.
+
+This collector supports collecting metrics from multiple instances of this integration, including remote instances.
+
+
+### Default Behavior
+
+#### Auto-Detection
+
+By default, it detects Apcupsd instances running on localhost that are listening on port 3551.
+On startup, it tries to collect metrics from:
+
+- 127.0.0.1:3551
+
+
+#### Limits
+
+The default configuration for this integration does not impose any limits on data collection.
+
+#### Performance Impact
+
+The default configuration for this integration is not expected to impose a significant performance impact on the system.
+
+
+## Metrics
+
+Metrics grouped by *scope*.
+
+The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
+
+
+
+### Per ups
+
+These metrics refer to the UPS unit.
+
+This scope has no labels.
+
+Metrics:
+
+| Metric | Dimensions | Unit |
+|:------|:----------|:----|
+| apcupsd.ups_status | TRIM, BOOST, CAL, ONLINE, ONBATT, OVERLOAD, LOWBATT, REPLACEBATT, NOBATT, SLAVE, SLAVEDOWN, COMMLOST, SHUTTING_DOWN | status |
+| apcupsd.ups_selftest | NO, NG, WN, IP, OK, BT, UNK | status |
+| apcupsd.ups_battery_charge | charge | percent |
+| apcupsd.ups_battery_time_remaining | timeleft | seconds |
+| apcupsd.ups_battery_time_since_replacement | since_replacement | seconds |
+| apcupsd.ups_battery_voltage | voltage, nominal_voltage | Volts |
+| apcupsd.ups_load_capacity_utilization | load | percent |
+| apcupsd.ups_load | load | Watts |
+| apcupsd.ups_temperature | temperature | Celsius |
+| apcupsd.ups_input_voltage | voltage, min_voltage, max_voltage | Volts |
+| apcupsd.ups_input_frequency | frequency | Hz |
+| apcupsd.ups_output_voltage | voltage | Volts |
+
+
+
+## Alerts
+
+
+The following alerts are available:
+
+| Alert name | On metric | Description |
+|:------------|:----------|:------------|
+| [ apcupsd_ups_load_capacity ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_load_capacity_utilization | APC UPS average load over the last 10 minutes |
+| [ apcupsd_ups_battery_charge ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_battery_charge | APC UPS average battery charge over the last minute |
+| [ apcupsd_last_collected_secs ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS number of seconds since the last successful data collection |
+| [ apcupsd_ups_selftest_warning ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_selftest | APC UPS self-test failed due to insufficient battery capacity or due to overload |
+| [ apcupsd_ups_status_onbatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS has switched to battery power because the input power has failed |
+| [ apcupsd_ups_status_overload ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS is overloaded and cannot supply enough power to the load |
+| [ apcupsd_ups_status_lowbatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS battery is low and needs to be recharged |
+| [ apcupsd_ups_status_replacebatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS battery has reached the end of its lifespan and needs to be replaced |
+| [ apcupsd_ups_status_nobatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS has no battery |
+| [ apcupsd_ups_status_commlost ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.ups_status | APC UPS communication link is lost |
+
+
+## Setup
+
+### Prerequisites
+
+No action required.
+
+### Configuration
+
+#### File
+
+The configuration file name for this integration is `go.d/apcupsd.conf`.
+
+
+You can edit the configuration file using the `edit-config` script from the
+Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory).
+
+```bash
+cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
+sudo ./edit-config go.d/apcupsd.conf
+```
+#### Options
+
+The following options can be defined globally: update_every, autodetection_retry.
+
+
+<details open><summary>Config options</summary>
+
+| Name | Description | Default | Required |
+|:----|:-----------|:-------|:--------:|
+| update_every | Data collection frequency. | 1 | no |
+| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no |
+| address | Apcupsd daemon address in IP:PORT format. | 127.0.0.1:3551 | yes |
+| timeout | Connection/read/write timeout in seconds. The timeout includes name resolution, if required. | 2 | no |
+
+</details>
+
+#### Examples
+
+##### Basic
+
+A basic example configuration.
+
+<details open><summary>Config</summary>
+
+```yaml
+jobs:
+ - name: local
+ address: 127.0.0.1:3551
+
+```
+</details>
+
+##### Multi-instance
+
+> **Note**: When you define multiple jobs, their names must be unique.
+
+Collecting metrics from local and remote instances.
+
+
+<details open><summary>Config</summary>
+
+```yaml
+jobs:
+ - name: local
+ address: 127.0.0.1:3551
+
+ - name: remote
+ address: 203.0.113.0:3551
+
+```
+</details>
+
+
+
+## Troubleshooting
+
+### Debug Mode
+
+**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature.
+
+To troubleshoot issues with the `apcupsd` collector, run the `go.d.plugin` with the debug option enabled. The output
+should give you clues as to why the collector isn't working.
<