How to list add-ons/integrations recently used
目的
Review the list of integrations that have recently been used in Hipchat Server.
ソリューション
All calls made by add-ons go through the Hipchat API which is served by the Coral service. A line similar to the one below will be logged to /var/log/hipchat/coral.log:
2017-06-02T07:49:35.649867+00:00 ip-10-0-171-76 coral-1: [/room/8#REQgT3WD9] API triggered by addon (19): RoomApi.get_room.GET
In order to get the integrations recently used, proceed as follows:
Get the used integrations IDs from the Coral logs:
grep "API triggered by addon ([1-9][0-9]*)" /var/log/hipchat/coral.log | cut -d'(' -f2 | cut -d')' -f1 | sort -u > /tmp/integration_ids.txt
Get the add-ons names from the database:
DBPASS=$(awk '/"pass"/ {gsub(/[",]/,"");print $2}' /hipchat/config/site.json) && mysql -uroot -p$DBPASS hipchat -e "SELECT id,name FROM addons WHERE id IN ($(paste -sd, /tmp/integration_ids.txt));"
Here's a sample output:
+----+------------------------------------+ | id | name | +----+------------------------------------+ | 18 | JIRA (localhost) | | 19 | Facebook | | 22 | Confluence (172.21.44.41) | | 30 | Vidyo | | 33 | Bitbucket (localhost) | | 80 | Mailroom | | 91 | Geek Advent | | 95 | JIRA (adridi.office.atlassian.com) | | 96 | Sassy | +----+------------------------------------+
注意
- The coral log might have been rotated. Older logs can be found gzipped and timestamped under /var/log/hipchat. For instance: /var/log/hipchat/coral.log-20170508-1494226441.gz.
- The last time an integration was used will correspond to the timestamp of the last line in the Coral log matching the pattern:
最終更新日: 2018 年 10 月 5 日
Powered by Confluence and Scroll Viewport.