Skip to content

Satak/ps-zabbix-host

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zabbix host Powershell Module

Publish PS Gallery PS Gallery

alt text

Powershell module PS-Zabbix-Host to install and register Zabbix agent/host on Windows

Version Info Date
0.0.6 More options to functions 18.09.2020
0.0.5 Initial release 11.09.2020
0.0.1-0.0.4 pre-release 10.09.2020

Commands

Command Info
Install-ZabbixAgent Downloads Zabbix agent and installs it for Windows x64 OS
New-ZabbixToken Login to Zabbix server and get token
New-ZabbixHost Use Zabbix REST API to create a new host (agent)
Get-LocalIPAddress Get IPv4 IP Address for creating new a Zabbix host

Usage

param(
    $username = 'Admin',
    $password = 'zabbix',
    $zabbixHost = '10.0.0.2'
)
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module -Name PS-Zabbix-Host -Force -Confirm:$False

# Zabbix server credentials
$credentials = New-Object System.Management.Automation.PSCredential(
  $userName,
  (ConvertTo-SecureString $password -AsPlainText -Force)
)

# download agent msi package from www.zabbix.com and install it
Install-ZabbixAgent

# IP address of the client where the agent is running
$ip = Get-LocalIPAddress

# Zabbix server token
$token = New-ZabbixToken -ZabbixHost $zabbixHost -Credentials $credentials

# create new host by using the REST API and token
New-ZabbixHost -ZabbixHost $zabbixHost -Token $token -AgentIPAddress $ip