Skip to content

PowerShell module for interacting with the Infoblox CLI via SSH

License

Notifications You must be signed in to change notification settings

rmbolger/Posh-IBCLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This PowerShell module makes it easier to automate Infoblox NIOS CLI commands via SSH. It is not intended to completely wrap every possible command. But it may include some common ones for information retrieval or grid administration.

The module relies heavily on the Posh-SSH module which itself relies on a custom version of SSH.NET.

Install

To install the latest development version from git, use the following command in PowerShell v3 or later:

iex (invoke-restmethod https://raw.githubusercontent.com/rmbolger/Posh-IBCLI/main/instdev.ps1)

You can also find the latest release version in the PowerShell Gallery. If you're on PowerShell v5 or later, you can install it with Install-Module.

Install-Module -Name Posh-IBCLI

You must enable the Remote Console on the Infoblox appliance you intend to manage. This can be done via the web UI in the properties of the grid or a specific grid member in the Security section.

Enable Remote Console in Web UI

It can also be done using the set remote_console command from the CLI if you already have serial access.

Quick Start

Almost all of the functions available require an IP/hostname and a PSCredential to establish a connection to a NIOS appliance. It is wise to make sure your IP/credentials work from a normal SSH client before trying them with the module.

$myhost = '10.10.10.10'
$cred = Get-Credential

In the simplest case, you can just run one of the Get-* commands directly with your connection variables.

Get-IBCLIStatus $myhost $cred

For automation or scripting scenarios, you're likely to run multiple commands against the same appliance or might need to run commands that haven't already been wrapped by functions. In these cases, you'll use Connect-IBCLI to get a ShellStream object that you can pass to subsequent commands. This helps with speed and efficiency because the functions won't need to establish multiple SSH connections to the appliance.

$stream = Connect-IBCLI $myhost $cred

Once you have your ShellStream object, you can use it with the various wrapped commands or arbitrary commands using Invoke-IBCLICommand.

Get-IBCLIStatus $stream
Invoke-IBCLICommand 'show capacity' $stream

For CLI commands that aren't already wrapped by functions and have interactive prompts, you can just use multiple Invoke-IBCLICommand calls in succession.

PS > Invoke-IBCLICommand 'set delete_tasks_interval 13' $stream
Current delete tasks interval is 14 days
The delete tasks interval has been changed to 13 days
Is this correct? (y or n):
PS > Invoke-IBCLICommand 'y' $stream
The delete tasks interval has been changed.
Infoblox >

Don't forget to disconnect when you're done.

Disconnect-IBCLI $stream

Requirements and Platform Support

  • Requires PowerShell v3 or later.
  • Requires Posh-SSH 1.7.5 or later.
  • Tested against NIOS 7.3.x.

Changelog

See CHANGELOG.md

About

PowerShell module for interacting with the Infoblox CLI via SSH

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published