Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
johnfelipe opened this issue Nov 9, 2022 · 18 comments

Comments

@johnfelipe
Copy link

johnfelipe commented Nov 9, 2022

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"}
@nielsengelen
Copy link
Collaborator

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

@johnfelipe
Copy link
Author

johnfelipe commented Nov 10, 2022

# 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:~#

@nielsengelen
Copy link
Collaborator

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.

@johnfelipe
Copy link
Author

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
Copy link
Author

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

@nielsengelen
Copy link
Collaborator

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.

@johnfelipe
Copy link
Author

SNAG-0048

is stock in this step

windows:

  • Telegraf

Linux:

  • influxdb 2.x

pls guide me for solve this one issue

@johnfelipe
Copy link
Author

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

@carceneaux
Copy link
Contributor

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

@jorgedlcruz
Copy link
Collaborator

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

@johnfelipe
Copy link
Author

johnfelipe commented Nov 12, 2022

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
Copy link
Author

@nielsengelen
Copy link
Collaborator

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.

@samumatic
Copy link

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?

@Gwen44-github
Copy link

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

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

@LorenzzoBazzanella
Copy link

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)

@wchesley
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants