grafana icon indicating copy to clipboard operation
grafana copied to clipboard

not working / windows server with password have veeam / ubuntu have influxdb2.0 + grafana

Open johnfelipe opened this issue 2 years ago • 18 comments

steps:

wget https://raw.githubusercontent.com/VeeamHub/grafana/master/veeam-availability-console-grafana/veeam-availability-console-script.sh

nano
##
InfluxDBURL="172.19.44.255"
InfluxDBPort="8086" #Default Port
InfluxDB="veeatelegraf2022" #Default Database

# Endpoint URL for login action
Username="USER"
Password="felipe"
RestServer="https://172.19.32.91"
RestPort="1281" #Default Port

##
chmod +x veeam-availability-console-script.sh
./veeam-availability-console-script.sh

or

wget https://raw.githubusercontent.com/jorgedlcruz/veeam-availability-console-grafana/master/veeam-availability-console-script.sh


nano
##
InfluxDBURL="172.19.44.255"
InfluxDBPort="8086" #Default Port
InfluxDB="veeatelegraf2022" #Default Database
InfluxDBUser="administrator" #User for Database
InfluxDBPassword="i-7enJEhB_5oDLxYZHNaWgtUkQM_so9sAX84PNIaM78v0EhACz7LOEBwnkkMMRi-cbHrOBslv1ICJKx2YbHYJg==" #Password for Database

# Endpoint URL for login action
Username="USER"
Password="felipe"
RestServer="172.19.32.91"
RestPort="1281" #Default Port

##

chmod +x veeam-availability-console-script.sh
./veeam-availability-console-script.sh

with same issue

root@ubuntu20portatil:~# ./veeam-availability-console-script.sh
./veeam-availability-console-script.sh: line 35: jq: command not found
./veeam-availability-console-script.sh: line 44: jq: command not found
./veeam-availability-console-script.sh: line 162: jq: command not found
./veeam-availability-console-script.sh: line 163: jq: command not found
./veeam-availability-console-script.sh: line 164: jq: command not found
./veeam-availability-console-script.sh: line 165: jq: command not found
./veeam-availability-console-script.sh: line 166: jq: command not found
./veeam-availability-console-script.sh: line 167: jq: command not found
./veeam-availability-console-script.sh: line 169: jq: command not found
./veeam-availability-console-script.sh: line 171: jq: command not found
./veeam-availability-console-script.sh: line 172: jq: command not found
./veeam-availability-console-script.sh: line 173: jq: command not found
./veeam-availability-console-script.sh: line 174: jq: command not found
./veeam-availability-console-script.sh: line 175: jq: command not found
./veeam-availability-console-script.sh: line 176: jq: command not found
./veeam-availability-console-script.sh: line 177: jq: command not found
./veeam-availability-console-script.sh: line 178: jq: command not found
./veeam-availability-console-script.sh: line 179: jq: command not found
./veeam-availability-console-script.sh: line 180: jq: command not found
./veeam-availability-console-script.sh: line 181: jq: command not found
./veeam-availability-console-script.sh: line 182: jq: command not found
HTTP/1.1 401 Unauthorized
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.5.1
X-Platform-Error-Code: unauthorized
Date: Wed, 09 Nov 2022 20:37:25 GMT
Content-Length: 48

{"code":"unauthorized","message":"Unauthorized"}

johnfelipe avatar Nov 09 '22 20:11 johnfelipe

You are missing the jq package. You can download and install it from https://stedolan.github.io/jq/download/ or use apt-get install jq (normally).

nielsengelen avatar Nov 10 '22 08:11 nielsengelen

# Endpoint URL for login action
Username="USER"
Password="felipe"
RestServer="https://172.19.32.91"
RestPort="1281" #Default Port

Restport is 1281 or 9419 same like swagger:

SNAG-0045

and application with 1281 is blocked:

SNAG-0046

or where review if working

And ./veeam_enterprisemanager.sh

show this errors:

Writing veeam_em_overview to InfluxDB
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.5.1
X-Platform-Error-Code: invalid
Date: Thu, 10 Nov 2022 14:36:35 GMT
Content-Length: 295

{"code":"invalid","message":"unable to parse 'veeam_em_overview,host=172.19.32.91 veeamBackupServers=,veeamProxyServers=,veeamRepositoryServers=,veeamRunningJobs=,veeamScheduledJobs=,veeamSuccessfulVmLastestStates=,veeamWarningVmLastestStates=,veeamFailedVmLastestStates=': missing field value"}Writing veeam_em_overview_vms to InfluxDB
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.5.1
X-Platform-Error-Code: invalid
Date: Thu, 10 Nov 2022 14:36:35 GMT
Content-Length: 326

{"code":"invalid","message":"unable to parse 'veeam_em_overview_vms,host=172.19.32.91 veeamProtectedVms=,veeamBackedUpVms=,veeamReplicatedVms=,veeamRestorePoints=,veeamFullBackupPointsSize=,veeamIncrementalBackupPointsSize=,veeamReplicaRestorePointsSize=,veeamSourceVmsSize=,veeamSuccessBackupPercents=': missing field value"}Writing veeam_em_overview_jobs to InfluxDB
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.5.1
X-Platform-Error-Code: invalid
Date: Thu, 10 Nov 2022 14:36:35 GMT
Content-Length: 433

{"code":"invalid","message":"unable to parse 'veeam_em_overview_jobs,host=172.19.32.91,veeamMaxDurationBackupJobName=None,veeamMaxDurationReplicaJobName=None veeamRunningJobs=,veeamScheduledJobs=,veeamScheduledBackupJobs=,veeamScheduledReplicaJobs=,veeamTotalJobRuns=,veeamSuccessfulJobRuns=,veeamWarningsJobRuns=,veeamFailedJobRuns=,veeamMaxJobDuration=,veeamMaxBackupJobDuration=,veeamMaxReplicaJobDuration=': missing field value"}root@ubuntu20portatil:~#

johnfelipe avatar Nov 10 '22 14:11 johnfelipe

The enterprise manager script is used against the Enterprise Manager within VBR. The other is for the veeam service provider console.

Depending on what you are running, you need to use 1 of the 2 scripts to the API port as found in the documentation.

nielsengelen avatar Nov 10 '22 15:11 nielsengelen

can u guide me pls i have enterprise with 1500 instance but i want to have grafana, i have influxdb 2.x, but im lost, because all show me invalid, im using this one:

wget https://raw.githubusercontent.com/VeeamHub/grafana/master/veeam-enterprise_manager-grafana/veeam_enterprisemanager.sh

johnfelipe avatar Nov 10 '22 15:11 johnfelipe

help me for solve "Unauthorized"

https://drive.google.com/file/d/1nw91SYDGWu9IM_12Rkd94GX33W4HFKj1/view?usp=drivesdk

Pls view that video link and help me ASAP

johnfelipe avatar Nov 10 '22 19:11 johnfelipe

There is a blog on how to set it up available at https://jorgedelacruz.uk/2020/01/07/looking-for-the-perfect-dashboard-influxdb-telegraf-and-grafana-part-xix-monitoring-veeam-with-enterprise-manager-shell-script/.

Unauthorised means that the credentials used against the API are invalid and u need to correct them.

nielsengelen avatar Nov 10 '22 20:11 nielsengelen

SNAG-0048

is stock in this step

windows:

  • Telegraf

Linux:

  • influxdb 2.x

pls guide me for solve this one issue

johnfelipe avatar Nov 11 '22 19:11 johnfelipe

i change default port with new one 9419

root@ubuntu20portatil:~# ./veeam_enterprisemanager.sh
Writing veeam_em_overview to InfluxDB
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.5.1
X-Platform-Error-Code: invalid
Date: Fri, 11 Nov 2022 19:11:31 GMT
Content-Length: 295

{"code":"invalid","message":"unable to parse 'veeam_em_overview,host=172.19.32.91 veeamBackupServers=,veeamProxyServers=,veeamRepositoryServers=,veeamRunningJobs=,veeamScheduledJobs=,veeamSuccessfulVmLastestStates=,veeamWarningVmLastestStates=,veeamFailedVmLastestStates=': missing field value"}Writing veeam_em_overview_vms to InfluxDB
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.5.1
X-Platform-Error-Code: invalid
Date: Fri, 11 Nov 2022 19:11:31 GMT
Content-Length: 326

{"code":"invalid","message":"unable to parse 'veeam_em_overview_vms,host=172.19.32.91 veeamProtectedVms=,veeamBackedUpVms=,veeamReplicatedVms=,veeamRestorePoints=,veeamFullBackupPointsSize=,veeamIncrementalBackupPointsSize=,veeamReplicaRestorePointsSize=,veeamSourceVmsSize=,veeamSuccessBackupPercents=': missing field value"}Writing veeam_em_overview_jobs to InfluxDB
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.5.1
X-Platform-Error-Code: invalid
Date: Fri, 11 Nov 2022 19:11:32 GMT
Content-Length: 433

{"code":"invalid","message":"unable to parse 'veeam_em_overview_jobs,host=172.19.32.91,veeamMaxDurationBackupJobName=None,veeamMaxDurationReplicaJobName=None veeamRunningJobs=,veeamScheduledJobs=,veeamScheduledBackupJobs=,veeamScheduledReplicaJobs=,veeamTotalJobRuns=,veeamSuccessfulJobRuns=,veeamWarningsJobRuns=,veeamFailedJobRuns=,veeamMaxJobDuration=,veeamMaxBackupJobDuration=,veeamMaxReplicaJobDuration=': missing field value"}

johnfelipe avatar Nov 11 '22 19:11 johnfelipe

@johnfelipe Please ensure you're using the script with the correct Veeam API. The scripts are named accordingly to match the Veeam API it leverages. As such, the veeam_enterprisemanager.sh script is designed to work with the Veeam Backup Enterprise Manager API which has a default port of 9398.

There currently does not exist a grafana integration in this repository for the Veeam Backup & Replication API.

I hope this clears things up for you.

carceneaux avatar Nov 11 '22 21:11 carceneaux

Hello John, Please install Veeam Enterprise Manager first - https://helpcenter.veeam.com/docs/backup/em/installing_veeam_backup_em.html?ver=110 then add your Veeam Backup & Replication server to it, and once you have data and everything on the EM UI, try the script again.

Thanks

jorgedlcruz avatar Nov 12 '22 09:11 jorgedlcruz

Now is working, but i have this not collecting:

https://drive.google.com/file/d/17qUOnVkfueAw-buHtKurXO1vWqXqDsbG/view?usp=drivesdk

How can review that NO DATA items?

johnfelipe avatar Nov 12 '22 17:11 johnfelipe

https://drive.google.com/file/d/17qUOnVkfueAw-buHtKurXO1vWqXqDsbG/view?usp=drivesdk

why that ones not collecting?

johnfelipe avatar Nov 17 '22 23:11 johnfelipe

You can run the script manually via bash to see if there is any output. For further troubleshooting, you will have to manually work against the Enterprise Manager as this is what the script does. It just reads the data coming from it.

There could be multiple reasons why there is no data (no backup jobs, no runs in the last X hours, API issue) and it's impossible for us to just say this via a video or screenshot.

nielsengelen avatar Nov 18 '22 09:11 nielsengelen

I have the same issue #25 running the script against the Veeam Service Provider Console (formerly the Veeam Availability Console), but getting a HTTP/1.1 400 Bad Request. I am sure, i am not running the wrong script (like the enterprise-console script) or targeting the wrong API (im targeting the VSPC API v2).

Am i confusing something?

samumatic avatar Jan 10 '23 12:01 samumatic

I have some metric not into grafana. When I launch the script (veeam_enterprisemanager.sh) I reveive 5 error : jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null)

Gwen44-github avatar Feb 22 '23 10:02 Gwen44-github

Can you tell me if I have alone with this problem and how to modify this script?

Gwen44-github avatar Mar 15 '23 08:03 Gwen44-github

Can you tell me if I have alone with this problem and how to modify this script?

Hello, I am also experiencing the same issue, along with the error below.

$ ./veeam_enterprisemanager.sh
Writing veeam_em_overview to InfluxDB HTTP/1.1 400 Bad Request Content-Type: application/json Request-Id: 99b68fa0-3b92-11ee-b81e-005056be56a1 X-Influxdb-Build: OSS X-Influxdb-Error: unable to parse 'veeam_em_overview,host=veeam-manager.ggdc.io veeamBackupServers=null,veeamProxyServers=null,veeamRepositoryServers=null,veeamRunningJobs=null,veeamScheduledJobs=null,veeamSuccessfulVmLastestStates=null,veeamWarningVmLastestStates=null,veeamFailedVmLastestStates=null': invalid number X-Influxdb-Version: 1.8.10 X-Request-Id: 99b68fa0-3b92-11ee-b81e-005056be56a1 Date: Tue, 15 Aug 2023 17:38:52 GMT Content-Length: 313

{"error":"unable to parse 'veeam_em_overview,host=veeam-manager.ggdc.io veeamBackupServers=null,veeamProxyServers=null,veeamRepositoryServers=null,veeamRunningJobs=null,veeamScheduledJobs=null,veeamSuccessfulVmLastestStates=null,veeamWarningVmLastestStates=null,veeamFailedVmLastestStates=null': invalid number"} Writing veeam_em_overview_vms to InfluxDB HTTP/1.1 400 Bad Request Content-Type: application/json Request-Id: 99cc321d-3b92-11ee-b81f-005056be56a1 X-Influxdb-Build: OSS X-Influxdb-Error: unable to parse 'veeam_em_overview_vms,host=veeam-manager.ggdc.io veeamProtectedVms=null,veeamBackedUpVms=null,veeamReplicatedVms=null,veeamRestorePoints=null,veeamFullBackupPointsSize=null,veeamIncrementalBackupPointsSize=null,veeamReplicaRestorePointsSize=null,veeamSourceVmsSize=null,veeamSuccessBackupPercents=null': invalid number X-Influxdb-Version: 1.8.10 X-Request-Id: 99cc321d-3b92-11ee-b81f-005056be56a1 Date: Tue, 15 Aug 2023 17:38:52 GMT Content-Length: 348

{"error":"unable to parse 'veeam_em_overview_vms,host=veeam-manager.ggdc.io veeamProtectedVms=null,veeamBackedUpVms=null,veeamReplicatedVms=null,veeamRestorePoints=null,veeamFullBackupPointsSize=null,veeamIncrementalBackupPointsSize=null,veeamReplicaRestorePointsSize=null,veeamSourceVmsSize=null,veeamSuccessBackupPercents=null': invalid number"} Writing veeam_em_overview_jobs to InfluxDB HTTP/1.1 400 Bad Request Content-Type: application/json Request-Id: 99e5a865-3b92-11ee-b820-005056be56a1 X-Influxdb-Build: OSS X-Influxdb-Error: unable to parse 'veeam_em_overview_jobs,host=veeam-manager.ggdc.io,veeamMaxDurationBackupJobName=null,veeamMaxDurationReplicaJobName=null veeamRunningJobs=null,veeamScheduledJobs=null,veeamScheduledBackupJobs=null,veeamScheduledReplicaJobs=null,veeamTotalJobRuns=null,veeamSuccessfulJobRuns=null,veeamWarningsJobRuns=null,veeamFailedJobRuns=null,veeamMaxJobDuration=null,veeamMaxBackupJobDuration=null,veeamMaxReplicaJobDuration=null': invalid number X-Influxdb-Version: 1.8.10 X-Request-Id: 99e5a865-3b92-11ee-b820-005056be56a1 Date: Tue, 15 Aug 2023 17:38:52 GMT Content-Length: 463

{"error":"unable to parse 'veeam_em_overview_jobs,host=veeam-manager.ggdc.io,veeamMaxDurationBackupJobName=null,veeamMaxDurationReplicaJobName=null veeamRunningJobs=null,veeamScheduledJobs=null,veeamScheduledBackupJobs=null,veeamScheduledReplicaJobs=null,veeamTotalJobRuns=null,veeamSuccessfulJobRuns=null,veeamWarningsJobRuns=null,veeamFailedJobRuns=null,veeamMaxJobDuration=null,veeamMaxBackupJobDuration=null,veeamMaxReplicaJobDuration=null': invalid number"} jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null)

LorenzzoBazzanella avatar Aug 15 '23 18:08 LorenzzoBazzanella

@LorenzzoBazzanella, @johnfelipe

InfluxDb has also undergone a major version update and the script, as it is right now, will not POST to influxDb v2.x+

The errors you are both encountering are from the InfluxDb API and not Veeams. I had to specify the bucket, org and modify the way values are POSTed to influxDb to get this working.

  • You will need to add org="yourOrgName" when POSTing data to influxDb API.
  • You will need to change db="InfluxDB" to bucket="InfluxDB"
  • You will have to change the data posted to InfluxDb as the Veeam endpoints have changed, but as this repo is right now, it will not work with InfluxDb 2.x+, I've not tested this with InfluxDb 1.7.x. See Write data with InfluxDb API
    • In essence though, you will need to specify your fields and tags when POSTing to InfluxDb API. It'll end up in the format of measurement,TagName=TagValue Field1=Field1Value,Field2=Field2Value ... FieldN=FieldNValue.
    • Note the space between TagName=TagValue and Field1=Field1, this threw me off for a bit.
    • Example for VSPC /organizations/companies endpoint:
    curl -i -XPOST "http://$InfluxDBURL:$InfluxDBPort/write?bucket=$InfluxDB&org=$InfluxDbOrg" \
    --header "Authorization: Token $InfluxDbApiKey" \
     --data-binary "veeam_vac_tenant,companyName=$TenantName  status=\"$TenantStatus\",canManageBackupServer=$TenantBackupServerManagementEnabled,canManageBackupAgent=$TenantBackupAgentManagementEnabled,canRestoreFiles=$TenantFileRestoreEnabled,canManageVBPublicCloud=$TenantVBPublicCloudManagementEnabled"
    

You might find this DBA - Stackexchange post helpful if your confused between fields and tags.

wchesley avatar Sep 26 '24 21:09 wchesley