AnyEvent-Porttracker

 view release on metacpan or  search on metacpan

Porttracker/protocol.pod  view on Meta::CPAN

Unsubscribes from the specified events - no further events of the
specified types will be received by this session.

=item "log" - log a message

   > [<id>, "log", <message>, <priority>]
   < [<id>, <status>]

Logs the given message as if tawnyd had logged it. The C<priority> is a
standard syslog priority, ranging from C<0> (C<emerg>) to 7 (C<debug>). IF
it is missing, then the message will be logged with priority C<info>.

=item "set_license" - configure a new licence

   > [<id>, "set_license", <license-string>]
   < [<id>, <status>]

Configures the given licence string as new licence for the box. Returns
successful if the licence is valid, fails otherwise.

Setting the license requires admin privileges.

=item "realm_info" - information about realms

   > [<id>, "realm_info", [<fields...>], [<realms...>]]
   < [<id>, 1, [ [<fields...>]... ]]

Example:

   > [1,"realm_info",["gid","description","polling","name","seeds"]]
   < [1,1,["5000015442","","0","Realm Name","192.168.33.19"]]

   > [1, "realm_info", ["gid", "discovery_result", "poll_result", "sync_result"]]
   < [1,1,["64424509927",{"infrastructure":13},{"poll":{"infrastructure":13,
        "ports":"339","end":"79"}},{"sync":{"qsync":null,"bsync":"Success"}}]]

Requests information about the given realms (or all realms if specified as
C<null>). The following fields can be requested, and their contents will be
returned in the order specified in the C<fields> array:

=over 4

=item gid - the gid (id value) identifying the realm

=item name - the user-specified name of the realm

=item description - the user-specified description for this realm

=item last_discover - timestamp of last discover run

=item last_poll - timestamp of last poll run

=item last_sync - timestamp of last sync run

=item polling - 0 (not polling) or 1 (currently polling)

=item syncing - 0 (not syncing) or 1 (currently syncing)

=item seeds - the seed list (whitespace-separated list of seed devices)

=item pollers - a list of poller-gids of pollers attached to the realm

=item discovery_result - a hash with key as infrastructure and value as number of devices discovered 

=item poll_result - a hash with keys infrastructure, ports and end and values as their counts

=item sync_result - a hash with keys qsync and bsync and values as their results

=item ageing_interval - ping sweep interval for this realm.

=back

=item "realm_info_modify" - edits the given realm

   > [<id>, "realm_info_modify", <realm-gid>, {<prop>:<value>,...}]
   < [<id>, 1]

A property hash followed by a realm gid. Keys of the hash are name,
description, discovery_poller and ageing_interval.

Example:

   > [1, "realm_info_modify", "38952865423", {"name":"default-1"}]
   < [1, 1]

=item "realm_modify" - adds and/or deletes realms

   > [<id>, "realm_modify", [delete-ids...], [[add-realm],...]]
   < [<id>, 1]

Two arrays expected as input. First array is a list of realm gids needs to be deleted.
Second array is a list of realm needs to be added. An array per realm can contain
realm name and description.

Example:

   > [1, "realm_modify", ["38456782341"], [["Test Realm", "for test"]]]
   < [1, 1]

=item "realm_discover" - run discovery on a given realm

   > [<id>, "realm_discover", <realm-gid>]
   < [<id>, 1]

=item "realm_poll" - run a poll on a given realm

   > [<id>, "realm_poll", <realm-gid>]
   < [<id>, 1, { <statistical data> } ]

=item "switch_poll" - run a poll on a given realm and switch ip

   > [<id>, "switch_poll", <realm-gid>, <switch ip>]
   < [<id>, 1, { <statistical data> } ]

=item "realm_sync" - run a sync on a given realm and plugin

   > [<id>, "realm_sync", <realm-gid>, <sync module>]
   < [<id>, 1]

The C<sync module> can be either bsync or qsync.

Porttracker/protocol.pod  view on Meta::CPAN

Example:

   > [1, "poller_info", ["gid", "name", "description", "hostname"]]
   < [1,1,[["64424509930","localhost","localhost","127.0.0.1"]]]


Requests information about the given pollers (or all pollers if specified as
C<null>). The following fields can be requested, and their contents will be
returned in the order specified in the C<fields> array:

=over 4

=item gid - the gid (id value) identifying the poller

=item name - the user-specified name of the poller

=item description - the user-specified description for this poller

=item hostname - hostname/ip of this poller

=item dns_max_outstanding - maximum number of dns queries for this poller

=back

=item "poller_modify" - adds and/or deletes pollers

This request adds and/or deletes given pollers.

   > [<id>, "poller_modify", <realm-gid>, [<delete-gid>, ...], 
        [[<name>, <description>, <hostname>, <secret>], ...]]
   < [<id>, 1]

Two arrays followed by a realm gid. First array is a list of poller gids 
needs to be deleted. Second array is a list of pollers needs to be added. 
An array per poller should contain poller name, description, hostname and
secret password.

Example:

   > [1, "poller_modify", "385611201213", ["98456723211"], [["test1", 
                  "Test poller", "127.0.0.1", "test"]]]
   < [1, 1]

=item "poller_info_modify - edits the given poller

This request edits the given poller with new values.

   > [<id>, "poller_info_modify", <poller-gid>, {<prop>:<value>,...}]
   < [<id>, 1]

A property hash followed by a poller gid. Keys expected in the hash
are name, description, hostname, secret and dns_max_outstanding.

Example:
  
   > [1, "poller_info_modify", "6789345621", {"name":"test1",
         "secret":"test123", "hostname":"localhost",
         "dns_max_outstanding":"65"}]
   < [1, 1]

=item "poller_subnet_list" - list subnets attached to a given poller

This request returns all subnets attached to a given poller.

   > [<id>, "poller_subnet_list", <poller-gid>]
   < [<id>, 1, [ [<subnet>, <bits>, <ping-limit>, <flags>]... ]]

The reply contains an array with all configured subnets. Each subnet
will contain the subnet address in textual form, the leading number of
significant bits in the subnet (0..32 for IPv4, 0..128 for IPv6), a ping
limit (in kbit/s) and a flags value (bit value C<1> indicates whether the
subnet is exclided (C<0>) or included (C<1>), bit value C<2> indicates
whether pings are enabled (C<2>) or not).

Example: 

   > [1, "poller_subnet_list", "64424509930"]
   < [1,1,[["1.1.1.1",32,1000,1,2],["10.1.1.1",32,1000,0,0]]]

=item "poller_subnet_list_modify" - modify subnets of a poller 

Removes and/or adds subnet entries.

   > [<id>, "poller_subnet_list_modify", <poller-gid>, [<remove-subnet>], [<add-subnet>...]]
   < [<id>, 1]

The two arrays after the poller-gid specify a list of subnet addresses to
remove (only exact matches wil be removed) and a list of subnet-entries to
be added afterwards. Each entry in the <add-subnet> list follows the same
format as returned by C<poller_subnet_list>.

Example: 

   > [ 1, "poller_subnet_list_modify", "64424509930",[["1.1.1.1",32,1000,1,2],
         ["10.1.1.1",32,1000,0,0]], [["192.168.0.0", 16, 1200, 1,2]] ]
   < [1, 1]

=item "global_settings" - list global settings

This request returns all global settings or specific settings.

   > [<id>, "global_settings"]
   < [<id>, 1, [ [<property>, <value>]... ]]

The reply contains an array with all configured properties and values. Each property
and value will be in textual form.

valid properties are

session_timeout, domain, smtp_server, max_history_length,
smtp_user, max_log_length

Example:

   > [1, "global_settings"]
   < [1,1,[["domain",""],["smtp_server",""],
        ["max_history_length","0"],["smtp_user",""]]]

   > [1, "global_settings", ["session_timeout"]]
   < [1,1,[["session_timeout","86400"]]]

=item "global_settings_modify" - modify global settings



( run in 1.333 second using v1.01-cache-2.11-cpan-e1769b4cff6 )