Skip to content

mrueg/netcupscp-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

netcupscp-exporter

Prometheus Exporter for Netcup ServerControlPanel (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
  • 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.

Grafana

A Grafana dashboard is available here.

A preview of the Grafana dashboard.

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 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