jjmartres / Zabbix

A great collection of Zabbix scripts and templates
GNU General Public License v2.0
878 stars 583 forks source link

Problem with Zabbix Veeam Template #108

Open msejdinoski opened 8 years ago

msejdinoski commented 8 years ago

Hi,

I get on multiple Zabbix Server the following error message:

Received value [The term 'Get-VBRBackupSession' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.At C:\Zabbix\zabbix_vbrjob.ps1:93 char:32+ $query = Get-VBRBackupSession <<<< | where { $.isCompleted -eq $false } | Measure + CategoryInfo : ObjectNotFound: (Get-VBRBackupSession:String) [] , CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException 0] is not suitable for value type [Numeric (float)]

It arises in the Trigger:

ZBX-VEEAM-BACKUP: Number of running job(s)

My Version: Zabbix 2.4.6 Veeam Backup & Replication 8.0.0.2084

Veeam PowerShell PSAddin are already installed.

Thank you for your quick help.

xenadmin commented 8 years ago

This forum post solved my problem. Had this too.

https://forums.veeam.com/powershell-f26/ps-install-failure-veeampssnapin-not-installed-t27871.html

I installed the plugin, but I didn't work. you can test this by starting PowerShell through Veeam. In your top left menu you should have a PowerShell Button. image If its not there. look in the forum post. If it's there, start it and see if the CMDLETS really get load or have the same error you reported above. If there is an error, look into the forum link.

msejdinoski commented 8 years ago

I've already tried.

PowerShell from the Veeam works on the server.

Even when I run the script manually, it works.

I have the same problem on multiple servers.

veeam-powershell

silviof commented 8 years ago

Hi, I have exactly the same issue. Running the script as active agent. Did you ever find a solution for this problem?

luponata commented 7 years ago

Hello, got the same error,

while running manually, the script works

if i put the veeam cmdlet options inside the default windows powershell profile, then i can remove the cmdlet variable inside the zabbix.ps1 script, since manually, it still works, of course it get loaded at every powershell session

but when the script is called from the zabbix server, it acts like the cmdlet never get loaded

J0HAN85 commented 7 years ago

I believe I've had this problem as well. I changed the UserParameter value in the zabbix_agentd.conf to:

UserParameter=vbr[*],%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -nologo -file "C:\Program Files\Zabbix Agent\scripts\zabbix_vbr_job.ps1" "$1" "$2"

luponata commented 7 years ago

OMG, problem solved! thank you :)