Version Module

Alfred Botman

Compatibility:

Description

This module will fetch version information of various packages (could also be other stuff).
Informations are put under cache by alfred, allowing you to retrieve latest received versions even if the bot is offline.

Configuration


{
   "vars": [
      "raid_status",
      "disk_full"
   ]
}
The vars array contains the list of custom variables to be shown when the .version command will list matching bots.

{
   "default_cmd" : "pkg info %s | grep 'Version' | cut -d':' -f2 | tr -d ' '",
   "versions_list" : [
      "botman",
      {
         "kernel": "uname -r"
      }
   ]
}
  • default_cmd: default command to use to fetch version of packages.
  • versions_list: array of packages to list.
    If the array item is a string, then the default_cmd will be used to find the version number.
    If the array item is an object, then it will use the given command.


Example use:

Alfred

(24/11/2015 08:52:29) guillaume.friloux@botnet.master.com: .version xxx
(08:52:29) Alfred Pennyworth:
Contacts that matched :
   online botman-xxx@botnet.master.com 

online botman-xxx@botnet.master.com :
   kernel : 10.1-RELEASE
   botman : 1.2.13_5

Alfred

This function allows to search over the version cache to find bots matching given package version. Supported conditions for package version matching are: <, <=, =, >=, >, !=.
(08:59:47) guillaume.friloux@botnet.master.com: .version find botman > 1.2.10
(08:59:47) Alfred Pennyworth:
Contacts that matched “botman>1.2.10” :

botman : 1.2.13_1
   online botman-aaa@botnet.master.com
   offline botman-bbb@botnet.master.com

botman : 1.2.13_5
   online botman-ccc8@xmpp-test.asp64.lan
   online botman-xxx@xmpp-test.asp64.lan

botman : 1.2.15_1
   offline botman-ddd@botnet.master.com
   online botman-eee@botnet.master.com