Documentation ¶
Index ¶
- Constants
- Variables
- func Attach(c APIClient, name, entity, sampler, group string)
- func RegisterPlugin(name string, plugin Plugin)
- type APIClient
- type Client
- type Columns
- type Dataview
- func (view *Dataview) Exists() (exists bool, err error)
- func (view *Dataview) RowsFromMap(rowdata interface{}) (rows [][]string, err error)
- func (view Dataview) RowsFromMapDelta(newrowdata, oldrowdata interface{}, interval time.Duration) (rows [][]string, err error)
- func (view *Dataview) RowsFromSlice(rowdata interface{}) (rows [][]string, err error)
- func (view *Dataview) Update() (err error)
- func (view *Dataview) UpdateTableFromMap(data interface{}) error
- func (view *Dataview) UpdateTableFromMapDelta(newdata, olddata interface{}, interval time.Duration) error
- func (view *Dataview) UpdateTableFromSlice(rowdata interface{}) error
- type Options
- type Plugin
- type RESTClient
- func (c *RESTClient) CreateDataview(entity, sampler, name string) (err error)
- func (c *RESTClient) CreateRow(entity, sampler, view, name string) (err error)
- func (c *RESTClient) CreateStream(entity, sampler, name string) (err error)
- func (c *RESTClient) DataviewExists(entity, sampler, name string) (bool, error)
- func (c *RESTClient) DeleteDataview(entity, sampler, name string) (err error)
- func (c *RESTClient) DeleteRow(entity, sampler, view, name string) (err error)
- func (c *RESTClient) Healthy() bool
- func (c *RESTClient) UpdateDataview(entity, sampler, name string, values [][]string) (err error)
- func (c *RESTClient) UpdateRow(entity, sampler, view, name string, values []string) (err error)
- func (c *RESTClient) UpdateStream(entity, sampler, name, message string) (err error)
- type XMLRPCClient
- func (c *XMLRPCClient) AddHeadline(entity, sampler, view, headline string) error
- func (c *XMLRPCClient) AddMessage(entity, sampler, stream, message string) error
- func (c *XMLRPCClient) AddTableColumn(entity, sampler, view, column string) error
- func (c *XMLRPCClient) AddTableRow(entity, sampler, view, row string) error
- func (c *XMLRPCClient) ColumnExists(entity, sampler, view, column string) (exists bool, err error)
- func (c *XMLRPCClient) CreateDataview(entity, sampler, name string) error
- func (c *XMLRPCClient) CreateRow(entity, sampler, view, name string) (err error)
- func (c *XMLRPCClient) CreateStream(entity, sampler, name string) (err error)
- func (c *XMLRPCClient) CreateView(entity, sampler, viewName, groupHeading string) (err error)
- func (c *XMLRPCClient) DataviewExists(entity, sampler, name string) (bool, error)
- func (c *XMLRPCClient) DeleteDataview(entity, sampler, name string) error
- func (c *XMLRPCClient) DeleteRow(entity, sampler, view, name string) (err error)
- func (c *XMLRPCClient) GatewayConnected() (connected bool, err error)
- func (c *XMLRPCClient) GetColumnCount(entity, sampler, view string) (count int, err error)
- func (c *XMLRPCClient) GetColumnNames(entity, sampler, view string) (names []string, err error)
- func (c *XMLRPCClient) GetHeadlineCount(entity, sampler, view string) (count int, err error)
- func (c *XMLRPCClient) GetHeadlineNames(entity, sampler, view string) (names []string, err error)
- func (c *XMLRPCClient) GetParameter(entity, sampler, parameter string) (param string, err error)
- func (c *XMLRPCClient) GetRowCount(entity, sampler, view string) (count int, err error)
- func (c *XMLRPCClient) GetRowNames(entity, sampler, view string) (names []string, err error)
- func (c *XMLRPCClient) GetRowNamesOlderThan(entity, sampler, view string, unixtime int64) (names []string, err error)
- func (c *XMLRPCClient) HeadlineExists(entity, sampler, view, headline string) (exists bool, err error)
- func (c *XMLRPCClient) Healthy() bool
- func (c *XMLRPCClient) Heartbeat(entity string, sampler string) (err error)
- func (c *XMLRPCClient) HeartbeatStream(entity, sampler, stream string) (err error)
- func (c *XMLRPCClient) ManagedEntityExists(entity string) (exists bool, err error)
- func (c *XMLRPCClient) RemoveHeadline(entity, sampler, view, headline string) error
- func (c *XMLRPCClient) RemoveTableRow(entity, sampler, view, row string) error
- func (c *XMLRPCClient) RemoveView(entity, sampler, viewName, groupHeading string) error
- func (c *XMLRPCClient) RowExists(entity, sampler, view, row string) (exists bool, err error)
- func (c *XMLRPCClient) SamplerExists(entity, sampler string) (exists bool, err error)
- func (c *XMLRPCClient) SignOff(entity string, sampler string) (err error)
- func (c *XMLRPCClient) SignOffStream(entity, sampler, stream string) (err error)
- func (c *XMLRPCClient) SignOn(entity, sampler string, seconds int) (err error)
- func (c *XMLRPCClient) SignOnStream(entity, sampler, stream string, seconds int) (err error)
- func (c *XMLRPCClient) UpdateDataview(entity, sampler, name string, values [][]string) error
- func (c *XMLRPCClient) UpdateEntireTable(entity, sampler, view string, values [][]string) error
- func (c *XMLRPCClient) UpdateHeadline(entity, sampler, view, headline, value string) error
- func (c *XMLRPCClient) UpdateRow(entity, sampler, view, name string, values []string) (err error)
- func (c *XMLRPCClient) UpdateStream(entity, sampler, name, message string) (err error)
- func (c *XMLRPCClient) UpdateTableCell(entity, sampler, view, cell, value string) error
- func (c *XMLRPCClient) UpdateTableRow(entity, sampler, view, row string, values []string) error
- func (c *XMLRPCClient) UpdateVariable(entity, sampler, view, variable, value string) error
- func (c *XMLRPCClient) ViewExists(entity, sampler, viewName string) (exists bool, err error)
Constants ¶
const ( MISC_ERROR = 100 NUMBER_OUT_OF_RANGE = 101 HOST_NOT_TRUSTED = 102 NO_SUCH_METHOD = 200 WRONG_PARAM_COUNT = 201 NO_SUCH_SAMPLER = 202 GATEWAY_NOT_CONNECTED = 203 GATEWAY_NOT_SUPPORTED = 204 SAMPLER_PARAM_NOT_FOUND = 300 VIEW_EXISTS = 301 NO_SUCH_VIEW = 302 NO_SUCH_STREAM = 303 VIEW_AND_GROUP_EQUAL = 304 SAMPLER_INACTIVE = 305 NO_SUCH_CELL = 400 ROW_EXISTS = 401 COLUMN_EXISTS = 402 NO_SUCH_HEADLINE = 403 HEADLINE_EXISTS = 404 NO_SUCH_ROW = 405 NO_SUCH_COLUMN = 406 COLUMN_MISMATCH = 407 NO_XML_SENT = 500 STREAM_BUFFER_FULL = 600 )
Error codes
Variables ¶
var (
ErrInvalidArgs = errors.New("invalid arguments")
)
Functions ¶
func RegisterPlugin ¶
Types ¶
type APIClient ¶
type APIClient interface { Healthy() bool CreateDataview(entity, sampler, name string) error UpdateDataview(entity, sampler, name string, values [][]string) error DeleteDataview(entity, sampler, name string) error CreateRow(entity, sampler, view, name string) error UpdateRow(entity, sampler, view, name string, values []string) error DeleteRow(entity, sampler, view, name string) error CreateStream(entity, sampler, name string) error UpdateStream(entity, sampler, name, message string) error DataviewExists(entity, sampler, name string) (bool, error) }
APIClient is the method set required for any API sending data into a Geneos Netprobe
func NewRESTClient ¶
type Columns ¶
type Columns map[string]columndetails
Columns is a common type for the map of rows for output.
func ColumnInfo ¶
func ColumnInfo(rowdata interface{}) (cols Columns, columnnames []string, sorting string, err error)
ColumnInfo is a helper function that takes a (flat) struct as input and returns an ordered slice of column names ready to update a dataview. Normally called once per sampler during initialisation.
The column names are the display names in the struct tags or the field name otherwise. The internal method parsetags() is where the valid options are defined in detail. More docs to follow.
The input is a type or an zero-ed struct as this method only checks the struct tags and doesn't care about the data
type Dataview ¶
type Dataview struct { APIClient Entity string Sampler string Name string // contains filtered or unexported fields }
func NewDataview ¶
func NewDataview(c Client, entity, sampler, typeName, viewName, groupHeading string) (view *Dataview, err error)
NewDataview returns a Dataview view. If the connection to the API fails then a nil pointer is returned. If the dataview does not exist in the Netprobe it is also created.
func (*Dataview) RowsFromMap ¶
RowFromMap is a helper function that takes a tagged (flat) struct as input and formats a row (slice of strings) using tags. TBD, but selecting the rowname, the sorting, the format and type conversion, scaling and labels (percent, MB etc.)
The data passed should NOT include column heading slice as it will be regenerated from the Columns data
func (Dataview) RowsFromMapDelta ¶
func (view Dataview) RowsFromMapDelta(newrowdata, oldrowdata interface{}, interval time.Duration) (rows [][]string, err error)
RowsFromMapDelta takes two sets of data and calculates the difference between them. Only numeric data is changed, any non-numeric fields are left unchanged and taken from newrowdata only. If an interval is supplied (non-zero) then that is used as a scaling value otherwise the straight numeric difference is calculated
This is for data like sets of counters that are absolute values over time
func (*Dataview) RowsFromSlice ¶
RowsFromSlice - results are not resorted, they are assumed to be in the order required
func (*Dataview) UpdateTableFromMap ¶
UpdateTableFromMap - Given a map of structs representing rows of data, render a simple table update by converting all data and sorting the rows by the sort column in the initialised ColumnNames member of the Sampler
Sorting the data is only to define the "natural sort order" of the data as it appears in a Geneos Dataview without further client-side sorting.
func (*Dataview) UpdateTableFromMapDelta ¶
func (view *Dataview) UpdateTableFromMapDelta(newdata, olddata interface{}, interval time.Duration) error
UpdateTableFromMapDelta calculates the difference between the previous values and current, scaled by the interval
func (*Dataview) UpdateTableFromSlice ¶
UpdateTableFromSlice - Given an ordered slice of structs of data the method renders a simple table of data as defined in the Columns part of Samplers
type Plugin ¶
type Plugin interface { Init() Interval() time.Duration SetInterval(time.Duration) Start() error Stop() error SampleNow() error }
func FindPlugin ¶
type RESTClient ¶
type RESTClient struct { }
func (*RESTClient) CreateDataview ¶
func (c *RESTClient) CreateDataview(entity, sampler, name string) (err error)
func (*RESTClient) CreateRow ¶
func (c *RESTClient) CreateRow(entity, sampler, view, name string) (err error)
func (*RESTClient) CreateStream ¶
func (c *RESTClient) CreateStream(entity, sampler, name string) (err error)
func (*RESTClient) DataviewExists ¶
func (c *RESTClient) DataviewExists(entity, sampler, name string) (bool, error)
func (*RESTClient) DeleteDataview ¶
func (c *RESTClient) DeleteDataview(entity, sampler, name string) (err error)
func (*RESTClient) DeleteRow ¶
func (c *RESTClient) DeleteRow(entity, sampler, view, name string) (err error)
func (*RESTClient) Healthy ¶
func (c *RESTClient) Healthy() bool
func (*RESTClient) UpdateDataview ¶
func (c *RESTClient) UpdateDataview(entity, sampler, name string, values [][]string) (err error)
func (*RESTClient) UpdateRow ¶
func (c *RESTClient) UpdateRow(entity, sampler, view, name string, values []string) (err error)
func (*RESTClient) UpdateStream ¶
func (c *RESTClient) UpdateStream(entity, sampler, name, message string) (err error)
type XMLRPCClient ¶
func (*XMLRPCClient) AddHeadline ¶
func (c *XMLRPCClient) AddHeadline(entity, sampler, view, headline string) error
AddHeadline adds a headline variable to the view.
func (*XMLRPCClient) AddMessage ¶
func (c *XMLRPCClient) AddMessage(entity, sampler, stream, message string) error
AddMessage adds a new message to the end of the stream.
func (*XMLRPCClient) AddTableColumn ¶
func (c *XMLRPCClient) AddTableColumn(entity, sampler, view, column string) error
AddTableColumn adds another column to the table. Each column must be unique.
func (*XMLRPCClient) AddTableRow ¶
func (c *XMLRPCClient) AddTableRow(entity, sampler, view, row string) error
AddTableRow adds a new, blank table row to the specified view. The name of each row must be unique to that table. An attempt to create two rows with the same name will result in an error.
func (*XMLRPCClient) ColumnExists ¶
func (c *XMLRPCClient) ColumnExists(entity, sampler, view, column string) (exists bool, err error)
ColumnExists check if the column exists.
func (*XMLRPCClient) CreateDataview ¶
func (c *XMLRPCClient) CreateDataview(entity, sampler, name string) error
func (*XMLRPCClient) CreateRow ¶
func (c *XMLRPCClient) CreateRow(entity, sampler, view, name string) (err error)
func (*XMLRPCClient) CreateStream ¶
func (c *XMLRPCClient) CreateStream(entity, sampler, name string) (err error)
func (*XMLRPCClient) CreateView ¶
func (c *XMLRPCClient) CreateView(entity, sampler, viewName, groupHeading string) (err error)
CreateView creates a new, empty view in the specified sampler under the specified groupHeading. This view will appear in Active Console once it has been created, even if no information has been added to it. For historic reasons, the groupHeading must not be the same as the viewName.
func (*XMLRPCClient) DataviewExists ¶
func (c *XMLRPCClient) DataviewExists(entity, sampler, name string) (bool, error)
func (*XMLRPCClient) DeleteDataview ¶
func (c *XMLRPCClient) DeleteDataview(entity, sampler, name string) error
func (*XMLRPCClient) DeleteRow ¶
func (c *XMLRPCClient) DeleteRow(entity, sampler, view, name string) (err error)
func (*XMLRPCClient) GatewayConnected ¶
func (c *XMLRPCClient) GatewayConnected() (connected bool, err error)
GatewayConnected checks whether the Gateway is connected to this NetProbe.
func (*XMLRPCClient) GetColumnCount ¶
func (c *XMLRPCClient) GetColumnCount(entity, sampler, view string) (count int, err error)
GetColumnCount returns the column count of the view.
func (*XMLRPCClient) GetColumnNames ¶
func (c *XMLRPCClient) GetColumnNames(entity, sampler, view string) (names []string, err error)
GetColumnNames returns the names of existing columns
func (*XMLRPCClient) GetHeadlineCount ¶
func (c *XMLRPCClient) GetHeadlineCount(entity, sampler, view string) (count int, err error)
GetHeadlineCount returns the headline count of the view.
func (*XMLRPCClient) GetHeadlineNames ¶
func (c *XMLRPCClient) GetHeadlineNames(entity, sampler, view string) (names []string, err error)
GetHeadlineNames returns the names of existing headlines
func (*XMLRPCClient) GetParameter ¶
func (c *XMLRPCClient) GetParameter(entity, sampler, parameter string) (param string, err error)
GetParameter retrieves the value of a sampler parameter that has been defined in the gateway configuration.
func (*XMLRPCClient) GetRowCount ¶
func (c *XMLRPCClient) GetRowCount(entity, sampler, view string) (count int, err error)
GetRowCount returns the row count of the view.
func (*XMLRPCClient) GetRowNames ¶
func (c *XMLRPCClient) GetRowNames(entity, sampler, view string) (names []string, err error)
GetRowNames returns the names of existing rows
func (*XMLRPCClient) GetRowNamesOlderThan ¶
func (c *XMLRPCClient) GetRowNamesOlderThan(entity, sampler, view string, unixtime int64) (names []string, err error)
GetRowNamesOlderThan returns the names of rows whose update time is older than the time provided. The timestamp, unixtime, should be provided as an int64 number of seconds elapsed since UNIX epoch, and not a time.Time - this is sent as a string to the API.
func (*XMLRPCClient) HeadlineExists ¶
func (c *XMLRPCClient) HeadlineExists(entity, sampler, view, headline string) (exists bool, err error)
HeadlineExists checks if the headline exists
func (*XMLRPCClient) Healthy ¶
func (c *XMLRPCClient) Healthy() bool
func (*XMLRPCClient) Heartbeat ¶
func (c *XMLRPCClient) Heartbeat(entity string, sampler string) (err error)
Heartbeat prevents the sampling status from becoming failed when no updates are needed to a sampler and the client is signed on. If this method is called when SignOn has not been called then it has no effect.
func (*XMLRPCClient) HeartbeatStream ¶
func (c *XMLRPCClient) HeartbeatStream(entity, sampler, stream string) (err error)
HeartbeatStream prevents the status from becoming failed when no updates are needed to a view and the client is signed on. If this method is called when SignOnStream has not been called then it has no effect.
func (*XMLRPCClient) ManagedEntityExists ¶
func (c *XMLRPCClient) ManagedEntityExists(entity string) (exists bool, err error)
ManagedEntityExists checks whether a particular Managed Entity exists on this NetProbe containing any API or API-Streams samplers.
func (*XMLRPCClient) RemoveHeadline ¶
func (c *XMLRPCClient) RemoveHeadline(entity, sampler, view, headline string) error
RemoveHeadline removes a headline from the view.
func (*XMLRPCClient) RemoveTableRow ¶
func (c *XMLRPCClient) RemoveTableRow(entity, sampler, view, row string) error
RemoveTableRow removes an existing row from the specified view.
func (*XMLRPCClient) RemoveView ¶
func (c *XMLRPCClient) RemoveView(entity, sampler, viewName, groupHeading string) error
RemoveView a view that has been created with CreateView
func (*XMLRPCClient) RowExists ¶
func (c *XMLRPCClient) RowExists(entity, sampler, view, row string) (exists bool, err error)
RowExists checks if the row exists
func (*XMLRPCClient) SamplerExists ¶
func (c *XMLRPCClient) SamplerExists(entity, sampler string) (exists bool, err error)
SamplerExists checks whether a particular API or API-Streams sampler exists on this NetProbe.
Note, it is unclear if there is an entity involved here, for now it joins the entity and sampler in the argument with a "."
func (*XMLRPCClient) SignOff ¶
func (c *XMLRPCClient) SignOff(entity string, sampler string) (err error)
SignOff cancels the commitment to provide updates to a sampler. If this method is called when SignOn has not been called then it has no effect.
func (*XMLRPCClient) SignOffStream ¶
func (c *XMLRPCClient) SignOffStream(entity, sampler, stream string) (err error)
SignOffStream cancels the commitment to provide updates to a stream. If this method is called when SignOnStream has not been called then it has no effect.
func (*XMLRPCClient) SignOn ¶
func (c *XMLRPCClient) SignOn(entity, sampler string, seconds int) (err error)
SignOn commits the API client to provide at least one heartbeat or update to the sampler within the time period specified. seconds should be at least 1 and no more than 86400 (24 hours). SignOn may be called again to change the time period without the need to sign off first.
func (*XMLRPCClient) SignOnStream ¶
func (c *XMLRPCClient) SignOnStream(entity, sampler, stream string, seconds int) (err error)
SignOnStream commits the API-STREAM client to provide at least one heartbeat or update to the stream within the time period specified. seconds should be at least 1 and no more than 86400 (24 hours). SignOnStream may be called again to change the time period without the need to sign off first.
func (*XMLRPCClient) UpdateDataview ¶
func (c *XMLRPCClient) UpdateDataview(entity, sampler, name string, values [][]string) error
func (*XMLRPCClient) UpdateEntireTable ¶
func (c *XMLRPCClient) UpdateEntireTable(entity, sampler, view string, values [][]string) error
UpdateEntireTable updates the entire table for a given view. This is useful if the entire table will change at once or the table is being created for the first time. The array passed should be two dimensional. The first row should be the column headings and the first column of each subsequent row should be the name of the row. The array should be at least 2 columns by 2 rows. Once table columns have been defined, they cannot be changed by this method.
func (*XMLRPCClient) UpdateHeadline ¶
func (c *XMLRPCClient) UpdateHeadline(entity, sampler, view, headline, value string) error
UpdateHeadline updates a headline variable. This performs the same action as updateVariable, but is fractionally faster as it is not necessary to determine the variable type.
func (*XMLRPCClient) UpdateRow ¶
func (c *XMLRPCClient) UpdateRow(entity, sampler, view, name string, values []string) (err error)
func (*XMLRPCClient) UpdateStream ¶
func (c *XMLRPCClient) UpdateStream(entity, sampler, name, message string) (err error)
func (*XMLRPCClient) UpdateTableCell ¶
func (c *XMLRPCClient) UpdateTableCell(entity, sampler, view, cell, value string) error
UpdateTableCell updates a single cell in a table. The standard row.column format should be used to reference a cell. This performs the same action as updateVariable, but is fractionally faster as it is not necessary to determine the variable type.
func (*XMLRPCClient) UpdateTableRow ¶
func (c *XMLRPCClient) UpdateTableRow(entity, sampler, view, row string, values []string) error
UpdateTableRow updates an existing row from the specified view with the new values provided.
func (*XMLRPCClient) UpdateVariable ¶
func (c *XMLRPCClient) UpdateVariable(entity, sampler, view, variable, value string) error
UpdateVariable can be used to update either a headline variable or a table cell. If the variable name contains a period (.) then a cell is assumed, otherwise a headline variable is assumed.
func (*XMLRPCClient) ViewExists ¶
func (c *XMLRPCClient) ViewExists(entity, sampler, viewName string) (exists bool, err error)
ViewExists checks whether a particular view exists in this sampler. viewName should be in the form group-view. This method is useful if no updates are needed in a long period of time, to check whether the NetProbe has restarted. If this were the case then the sampler would exist, but the view would not.