Describe the bug
I am following the instructions at Looking for the Perfect Dashboard: InfluxDB, Telegraf and Grafana โ Part XIV โ Veeam Availability Console
Error message from command line when executing the veeam-availability-console-script.sh:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.2.0
X-Platform-Error-Code: invalid
Date: Mon, 19 Dec 2022 11:39:43 GMT
Content-Length: 451
{"code":"invalid","message":"unable to parse 'veeam_vac_vcclicense,edition=,status=,type=,contactPerson=,backupServerName=,companyName= licenseExpirationDate=(censored),supportExpirationDate=(censored),licensedCloudConnectBackups=,usedCloudConnectBackups=,licensedCloudConnectReplicas=,usedCloudConnectReplicas=,licensedCloudConnectServers=,usedCloudConnectServers=,licensedCloudConnectWorkstations=,usedCloudConnectWorkstations=': missing tag value"}
Steps to get there
My Veeam Service Provider Console v2 API:
![image](https://user-images.githubusercontent.com/62831433/211554083-319c2bc6-4f09-4aab-9a46-bd1085af63e2.png)
wget https://raw.githubusercontent.com/jorgedlcruz/veeam-availability-console-grafana/master/veeam-availability-console-script.sh
vim veeam-availability-console-script.sh
##
# Configurations
##
# Endpoint URL for InfluxDB
InfluxDBURL="192.168.178.11"
InfluxDBPort="8086" #Default Port
InfluxDB="mybucket" #Default Database
InfluxDBUser="myuser" #User for Database
InfluxDBPassword="mypassword" #Password for Database
# Endpoint URL for login action
Username="VSPCuser"
Password="VSPCpassword"
RestServer="vspc.myhome.lan"
RestPort="1281" #Default Port
:wq
sudo chmod +x veeam-availability-console-script.sh
./veeam-availability-console-script.sh
Expected behavior
It should look like this, according to the blog:
HTTP/1.1 204 No Content
Content-Type: application/json
Request-Id: 3565d5b6-011d-11e9-81c7-000000000000
X-Influxdb-Build: OSS
X-Influxdb-Version: 1.6.3
X-Request-Id: 3565d5b6-011d-11e9-81c7-000000000000
Date: Sun, 16 Dec 2018 10:27:37 GM
Describe the bug
I am partially following the instructions from Looking for the Perfect Dashboard: InfluxDB, Telegraf and Grafana โ Part XIV โ Veeam Availability Console using the veeam-availability-console-script.sh script from VeeamHub.
With the config like this:
##
# Configurations
##
# Endpoint URL for InfluxDB
InfluxDBURL="192.168.178.11"
InfluxDBPort="8086" #Default Port
InfluxDB="mybucket" #Default Database
# Endpoint URL for login action
Username="domain\\myuser"
Password="mypassword"
RestServer="https://vspc.myhome.lan"
RestPort="1281" #Default Port
The console is giving me this:
=================================
Retrieving licenses per tenant...
=========================================
Retreiving other licenses....
HTTP/1.1 401 Unauthorized
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.2.0
X-Platform-Error-Code: unauthorized
Date: Tue, 10 Jan 2023 12:57:57 GMT
Content-Length: 55
{"code":"unauthorized","message":"unauthorized access"}
I am aware that this console output is the result of the script not being able to log into the influxdb, and therefore not being able to write data into it.
However, it is not clear to me how I can solve this, as the script does not provide a solution or create a variable for username and password, or an authentication token.
When I edit the file, so that an authentication is sent on the CURL post like this:
InfluxDBUser="myuser" #User for Database
InfluxDBPassword="mypassword" #Password for Database
[...]
curl -i -XPOST "http://$InfluxDBURL:$InfluxDBPort/write?precision=s&db=$InfluxDB" -u "$InfluxDBUser:$InfluxDBPassword" --data-binary "veeam_vac_tenant,companyName=$TenantName,enabled=$TenantEnabled,expirationEnabled=$TenantexpirationEnabled,bandwidthThrottlingEnabled=$TenantbandwidthThrottlingEnabled expirationDate=$TenantexpirationDateUnix,maxConcurrentTasks=$TenantmaxConcurrentTasks,allowedBandwidth=$TenantallowedBandwidth,vMsBackedUp=$TenantvMsBackedUp,vMsReplicated=$TenantvMsReplicated,vMsBackedUpToCloud=$TenantvMsBackedUpToCloud,managedPhysicalWorkstations=$TenantmanagedPhysicalWorkstations,managedCloudWorkstations=$TenantmanagedCloudWorkstations,managedPhysicalServers=$TenantmanagedPhysicalServers,managedCloudServers=$TenantmanagedCloudServers"
I am getting the same error as above:
=================================
Retrieving licenses per tenant...
=========================================
Retreiving other licenses....
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.2.0
X-Platform-Error-Code: invalid
Date: Tue, 10 Jan 2023 14:18:48 GMT
Content-Length: 451
{"code":"invalid","message":"unable to parse 'veeam_vac_vcclicense,edition=,status=,type=,contactPerson=,backupServerName=,companyName= licenseExpirationDate=1673305200,supportExpirationDate=1673305200,licensedCloudConnectBackups=,usedCloudConnectBackups=,licensedCloudConnectReplicas=,usedCloudConnectReplicas=,licensedCloudConnectServers=,usedCloudConnectServers=,licensedCloudConnectWorkstations=,usedCloudConnectWorkstations=': missing tag value"}