Page 1 of 1

Plugin for Veeam Backup Help needed

Posted: Sat Nov 18, 2017 9:32 pm
by kwhogster
Hello

Nagios Core 4.1

I found this plugin
https://exchange.nagios.org/directory/P ... ck/details

My nsclient.ini entry

; check veeam backups
checkveeambu = cmd /c echo scripts/powershell/check_veeam.ps1 $ARG1$; exit $LastExitCode | powershell.exe -command -

from powershell
PS C:\program files\nsclient++\scripts\powershell> ./check_veeam.ps1 "Win 10 VM Backup" 5
OK! Backup process of job 'Win 10 VM Backup' completed successfully.

from Nagios
root@SERV017://usr/lib/nagios/plugins# ./check_nrpe -u -H SERV008 -t 120 -c checkveeambu "Win 10 VM Backup"
UNKNOWN! No such a job: '$'.

Any ideas?

Re: Plugin for Veeam Backup Help needed

Posted: Mon Nov 20, 2017 4:22 pm
by kyang
Did you follow this kb article? You could double check how you added the script into the nsclient.ini?
https://support.nagios.com/kb/article.php?id=528

I'm not exactly sure, but when running it with NRPE, could you try putting "Win 10 VM Backup" with -a.

Code: Select all

./check_nrpe -u -H SERV008 -t 120 -c checkveeambu -a "Win 10 VM Backup"
Let us know. Thanks!

Re: Plugin for Veeam Backup Help needed

Posted: Mon Nov 20, 2017 9:13 pm
by kwhogster
Hello

The -a helped a little

root@serv017:/usr/lib/nagios/plugins# ./check_nrpe -u -H SERV008 -t 120 -c checkveeambu -a "Win_10_VM_Backup"
UNKNOWN! No such a job: 'Win_10_VM_Backup'.
root@serv017:/usr/lib/nagios/plugins# ./check_nrpe -u -H SERV008 -t 120 -c checkveeambu -a "Win 10 VM Backup"
UNKNOWN! No such a job: 'Win'.


Again when I run the script directly on the veeam server it works it is a problem with the command

I have other powershell scripts that work fine on many other devises including this server.

Thoughts?

Re: Plugin for Veeam Backup Help needed

Posted: Tue Nov 21, 2017 3:54 pm
by kyang
Anything noticeable when you don't pass the -a "Win 10 VM Backup

Or is it just the normal not enough "ARGS"

Re: Plugin for Veeam Backup Help needed

Posted: Tue Nov 21, 2017 9:14 pm
by kwhogster
from the nsclient.ini added another ARG

; check veeam backups
checkveeambu = cmd /c echo scripts/powershell/check_veeam.ps1 $ARG1$ $ARG2$; exit $LastExitCode | powershell.exe -command -

without the -a

root@serv017:/usr/lib/nagios/plugins# ./check_nrpe -u -H SERV008 -t 120 -c checkveeambu 'Win 10 VM Backup' 1
UNKNOWN! No such a job: '$'.
with the -a
root@serv017:/usr/lib/nagios/plugins# ./check_nrpe -u -H SERV008 -t 120 -c checkveeambu -a 'Win 10 VM Backup' 1
UNKNOWN! No such a job: 'Win'.

Then I added underscores to the name

root@serv017:/usr/lib/nagios/plugins# ./check_nrpe -u -H SERV008 -t 120 -c checkveeambu -a 'Win_10_VM_Backup' 1
UNKNOWN! No such a job: 'Win_10_VM_Backup'.

Again when I run the powershell script on the server it works

It is a syntax issue with the command not sure what it wrong

Re: Plugin for Veeam Backup Help needed

Posted: Wed Nov 22, 2017 3:43 pm
by dwhitfield
What other plugins have you tried? This one uses vbs instead of powershell, so if there is some sort of powershell version difference this will work around that: https://exchange.nagios.org/directory/P ... bs/details

Can you upload your entire nsclient.ini? What version of nsclient are you using?

Re: Plugin for Veeam Backup Help needed

Posted: Wed Nov 22, 2017 4:21 pm
by kwhogster
NSclient version is 4.4.23

I downloaded several of the plugins for Veeam Checks all work when running from the veeam Windows 2012 R2 server but not from Nagios command line.

I tested the one you just poste and got these results

root@serv017:/usr/lib/nagios/plugins# ./check_nrpe -u -H SERV008 -t 120 -c checkveeam2
C:\Program Files\NSClient++\scripts\check_veeam.vbs(18, 1) Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied

You will see I have several different entries in my ini for check Veeam

I use a SQL server for the VEEAM database I do not use the veeam internal database.

Thoughts

Re: Plugin for Veeam Backup Help needed

Posted: Fri Nov 24, 2017 12:08 pm
by kwhogster
Thanks for all the help I figured it our yes it was a syntax issue with the command lines

First in the nsclient.ini had to place " " around the $ARG

; check veeam backups
checkveeambu = cmd /c echo scripts/powershell/check_veeam.ps1 "$ARG1$" "$ARG2$"; exit $LastExitCode | powershell.exe -command -

The command line then needs single quotes

root@serv017:/usr/lib/nagios/plugins# ./check_nrpe -u -H SERV008 -t 120 -c checkveeambu -a 'Win 81 VM Backup' 5
OK! Backup process of job 'Win 81 VM Backup' completed successfully.

This is the plugin I got working
https://exchange.nagios.org/directory/P ... ck/details



Success

Please lock this as resolved.