https://github.com/mrueg/netcupscp-exporter
Prometheus Exporter for Netcup Server Control Panel (SCP)
https://github.com/mrueg/netcupscp-exporter
exporter metrics netcup prometheus scp servercontrolpanel
Last synced: 7 months ago
JSON representation
Prometheus Exporter for Netcup Server Control Panel (SCP)
- Host: GitHub
- URL: https://github.com/mrueg/netcupscp-exporter
- Owner: mrueg
- License: mpl-2.0
- Created: 2021-12-30T22:29:53.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-27T16:10:22.000Z (over 1 year ago)
- Last Synced: 2024-05-28T20:18:58.917Z (over 1 year ago)
- Topics: exporter, metrics, netcup, prometheus, scp, servercontrolpanel
- Language: Go
- Homepage:
- Size: 331 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# netcupscp-exporter
Prometheus Exporter for [Netcup ServerControlPanel (SCP) WebService](https://www.netcup-wiki.de/wiki/Netcup_SCP_Webservice) to provide external visibility into server state.> [!NOTE]
> As per Netcup support, be aware that they do not provide support for their own API.
> Endpoints might change or break suddenly.
> Due to the limited documentation, this exporter makes a couple of assumptions when interpreting the responses of the API.
> Therefore, treat any values you get with caution.
> This repository is not affiliated with Netcup.## Usage
* Log into [SCP](https://servercontrolpanel.de)
* Activate WebService and generate a password/token for it
* Use token for this exporter in conjunction with your user id```
./netcupscp-exporter --login-name ID --password PASSWORD
```Default port: 9757
### Helm Chart
A Helm Chart is available [here](https://github.com/christianknell/helm-charts/tree/main/charts/netcupscp-exporter).
### Grafana
A Grafana dashboard is available [here](https://grafana.com/grafana/dashboards/16705).

## Metrics
```
# HELP scp_build_info A metric with a constant '1' value labeled by version, revision, branch, and goversion from which scp was built.
# TYPE scp_build_info gauge
scp_build_info{branch="",goversion="go1.17.5",revision="71a8595111dd83c45d9c0dd1e7d4418fc9f6928a",version="v0.1.0"} 1
# HELP scp_cpu_cores Number of CPU cores
# TYPE scp_cpu_cores gauge
scp_cpu_cores{vserver="servername"} 4
# HELP scp_disk_capacity_bytes Available storage space in Bytes
# TYPE scp_disk_capacity_bytes gauge
scp_disk_capacity_bytes{driver="scsi",name="vda",vserver="servername"} 3.4359738368e+11
# HELP scp_disk_optimization Optimization recommended (1) / not recommended (0)
# TYPE scp_disk_optimization gauge
scp_disk_optimization{driver="scsi",message="",name="vda",vserver="servername"} 0
# HELP scp_disk_used_bytes Used storage space in Bytes
# TYPE scp_disk_used_bytes gauge
scp_disk_used_bytes{driver="scsi",name="vda",vserver="servername"} 3.221225472e+09
# HELP scp_interface_throttled Interface's traffic is throttled (1) or not (0)
# TYPE scp_interface_throttled gauge
scp_interface_throttled{driver="virtio",id="iface_id",ip="1.2.3.4",ip_type="ipv4",mac="aa:bb:cc:dd:ee:ff",throttle_message="",vserver="servername"} 0
scp_interface_throttled{driver="virtio",id="iface_id",ip="1:2:3:4::/64",ip_type="ipv6",mac="aa:bb:cc:dd:ee:ff",throttle_message="",vserver="servername"} 0
# HELP scp_ip_info IPs assigned to this server
# TYPE scp_ip_info gauge
scp_ip_info{ip="1.2.3.4",vserver="servername"} 1
scp_ip_info{ip="1:2:3:4::",vserver="servername"} 1
# HELP scp_memory_bytes Amount of Memory in Bytes
# TYPE scp_memory_bytes gauge
scp_memory_bytes{vserver="servername"} 1.8013487104e+10
# HELP scp_monthlytraffic_in_bytes Monthly traffic incoming in Bytes (only gigabyte-level resolution)
# TYPE scp_monthlytraffic_in_bytes gauge
scp_monthlytraffic_in_bytes{month="1",vserver="servername",year="2022"} 2.097152e+06
# HELP scp_monthlytraffic_out_bytes Monthly traffic outgoing in Bytes (only gigabyte-level resolution)
# TYPE scp_monthlytraffic_out_bytes gauge
scp_monthlytraffic_out_bytes{month="1",vserver="servername",year="2022"} 0
# HELP scp_monthlytraffic_total_bytes Total monthly traffic in Bytes (only gigabyte-level resolution)
# TYPE scp_monthlytraffic_total_bytes gauge
scp_monthlytraffic_total_bytes{month="1",vserver="servername",year="2022"} 2.097152e+06
# HELP scp_reboot_recommended Reboot recommended (1) / not recommended (0)
# TYPE scp_reboot_recommended gauge
scp_reboot_recommended{message="",vserver="servername"} 0
# HELP scp_rescue_active Rescue system active (1) / inactive (0)
# TYPE scp_rescue_active gauge
scp_rescue_active{message="",vserver="servername"} 0
# HELP scp_server_start_time_seconds Start time of the vserver in seconds (only minute-level resolution)
# TYPE scp_server_start_time_seconds gauge
scp_server_start_time_seconds{vserver="servername"} 1.64047511e+09
# HELP scp_server_status Online (1) / Offline (0) status
# TYPE scp_server_status gauge
scp_server_status{nickname="nick1",status="online",vserver="servername"} 1
```## Build
```
make
```
or
```
docker build -o netcupscp-exporter .
```## Maintenance
### Generating the SOAP client
Generated by [gowsdl](https://github.com/hooklift/gowsdl/) via```
gowsdl -p scpclient -o scpclient.go <(curl "https://www.servercontrolpanel.de/SCP/WSEndUser?wsdl")
```Manual adjustments:
* Remove the namespace `http://enduser.service.web.vcp.netcup.de/` in return XML Names
* Add ``XMLName xml.Name `xml:"tns:func"` `` to the functions
* Add ``Xmlns string `xml:"xmlns:tns,attr" json:"-"` `` to set the namespace on these functions