Documentation forKiwi CatTools

Kiwi CatTools API: Device class

The Device class is used encapsulates a Kiwi CatTools device.

Properties

AAAUsername / AAAPassword

The username and password to use if your device requires a username/password login.

AAAUserPrompt / AAAPassword Prompt

The prompt request for the username and/or password of your device.

ActivitySpecific1 / ActivitySpecific2

Not used

Address1 / Address2 / Address3

The location of the device.

AlertEmail

User to receive notifications by e-mail for any triggered alerts from this device.

AssetTag

Asset tag information.

ConnectionMethod

The method to use when connecting to this device. 

  • For example: Telnet or SSH2.
ConnectVia

The name of the device to connect via.

ConnectViaID

The ID of the device to connect via.

  • An ID of -1 indicates a direct connection.
ConsolePassword

The console (com port connection) password.

ConsolePrompt

What does the console password request look like from your device.

ContactName / ContactEmail / ContactPhone / ContactOther

Contact information for the person responsible for a device.

EnablePassword

The password to get into enable mode.

EnablePrompt

What does the enable password request look like from your device.

EnableUsesAAA

Does entering enable mode require username/password validation?

FileName

The base file name for the device.

Group

The name of the Group the device belongs to.

For example: Default

GroupID

The id corresponding to the Group field. -1 indicates a new Group is to be created.

HostAddress

The IP address or host address for this device.

ID

The id that identifies this device in the database.

Identification

Identification info for this device.

LoginUsesAAA

Does connecting to the device require username/password validation?

Model

A value describing the model of the device.

Name

A unique name that describes this device.

Port

The port to use when connecting to this device.

PrivilageLevel

Sets the enable mode privilege level.

RequireVTYLogin

Does connecting to the device require password only validation?

SerialNumber

The serial number for the device.

SerialOther

Additional serial number information.

SNMPRead

SNMP Read community name.

SNMPWrite

SNMP Write community name.

SSHPassword

The SSH password required for SSH connections to this device.

SSHUsername

The SSH username required for SSH connections to this device.

TypeID

The id of the device-type eg 10

TypeOfDevice

The name of the device-type.

For example: Cisco.Router.General

VTYPassword

The password to use if your device verifies using a password only to log in.

VTYPrompt

What does a password request look like from your device.

Example code: Add, edit, or delete entries in a database

The following sample Visual Basic code showing you how to use the Device object of the CatTools API to add, edit or delete an entry in the database.

Add an entry to a database

Dim DB As CatToolsAPI.Database
Dim Device As CatToolsAPI.Device

Set DB = New CatToolsAPI.Database
If DB.OpenConnection Then
	Set Device = DB.Devices.AddNew("Cisco.Router.General")
	If Not Device Is Nothing Then
		Device.Name = "My Device 01"
		Device.HostAddress = "192.168.1.1"
		Device.Group = "My Test Group"
		Device.RequireVTYLogin = True
		Device.VTYPass = "My Password"
		Device.ConnectionMethod = "Telnet"
		If DB.Devices.SaveDevice(Device) Then
			Debug.Print Device.Name & " saved to the database OK."
		Else
			Debug.Print "Adding " & Device.Name & " failed: " & DB.ErrDescription
		End If
	Else
		Debug.Print "Creation of a new device failed: " & DB.ErrDescription
	End If
Else
	Debug.Print "DB connection failed: " & DB.ErrDescription
End If

Set Device = Nothing
Set DB = Nothing

Edit an entry in a database

Dim DB As CatToolsAPI.Database
Dim Devices As CatToolsAPI.Devices
Dim Device As CatToolsAPI.Device

Set DB = New CatToolsAPI.Database
If DB.OpenConnection Then
	Set Devices = DB.Devices
	Set Device = Devices.GetByName("My Device 01")
	If Not Device Is Nothing Then
		Debug.Print Device.Name & " Loaded OK"
		Device.AAAPassword = "My New Password "
		If Devices.SaveDevice(Device) Then
			Debug.Print Device.Name & " saved OK"
		Else
			Debug.Print Device.Name & " NOT saved: " & DB.ErrDescription
		End If
	Else
		Debug.Print "Device not found"
	End If
Else
	Debug.Print "DB connection failed: " & DB.ErrDescription
End If

Set Device = Nothing
Set Devices = Nothing
Set DB = Nothing

Delete an entry from a database

Dim DB As CatToolsAPI.Database

Set DB = New CatToolsAPI.Database
If DB.OpenConnection Then
	If DB.Devices.DeleteByName("My Device 01") Then
		Debug.Print "Deleted OK"
	Else
		Debug.Print "Delete failed: " & DB.ErrDescription
	End If
Else
	Debug.Print "DB connection failed: " & DB.ErrDescription
End If

Set DB = Nothing