Jump to content

User:中華科學警察

From mediawiki.org

Several irc logbots live here. Each is started like this:

$ sudo -iu local-morebots $ jstart -N <botname> /usr/lib/adminbot/adminlogbot.py --config ./confs/<config-for-this-bot>

To get a list of running bots:

$ become morebots $ qstat

To stop a running bot:

$ become morebots $ qdel <job#>


The bots are:

analytics-logbot: Lives in #wikimedia-analytics and logs to www.mediawiki.org/wiki/Analytics/Server_Admin_Log

labs-logbot: Lives in #wikimedia-cloud and logs to https://wikitech.wikimedia.org/wiki/Labs_Server_Admin_Log

morebots: Lives in #wikimedia-operations and logs to wikitech.wikimedia.org/wiki/Server_Admin_Log

qa-morebots: Lives in #wikimedia-releng and logs to https://wikitech.wikimedia.org/wiki/Release_Engineering/SAL

test-logbot: Lives in #morebots-test and logs to www.mediawiki.org/wiki/Analytics/Server_Admin_Log (This one is generally not running, just here as a dev tool.)

become morebots qstat

  1. now find the instance running on labs

qdel <id> ./labs.sh jstart -N production-logbot /usr/lib/adminbot/adminlogbot.py --config ./confs/production-logbot.py

Manual on MediaWiki Tools
morebots
Release status: unknown
Description Server Admin Log irc bot
Author(s) Andrew Bogott, Antoine Musso, Kunal Mehta, Ori Livneh, Reedy, Ryan Lane
License GPL-3.0+
Download No link
Issues : Open tasks · Report a bug
Morebots has been replaced by Stashbot in Wikimedia IRC channels.

morebots is a Python server admin log updatin' bot.

morebots listens in these channels on irc.freenode.net:

We also have qa-morebots to log to Release Engineering/SAL:

  • #wikimedia-releng

Setup

[edit]

It runs from Wikimedia Tool Labs under the "morebots" account. Bots are started and stopped using normal tool labs conventions.

Source code is here: <https://gerrit.wikimedia.org/r/gitweb?p=operations/debs/adminbot.git;a=tree>.

README

[edit]
Several irc logbots live here.  Each is started like this:

$ sudo -iu local-morebots
$ jstart -N <botname> /usr/lib/adminbot/adminlogbot.py --config ./confs/<config-for-this-bot>

To get a list of running bots:

$ become morebots
$ qstat

To stop a running bot:

$ become morebots
$ qdel <job#>


The bots are:

analytics-logbot:  Lives in #wikimedia-analytics and logs to www.mediawiki.org/wiki/Analytics/Server_Admin_Log

labs-logbot:  Lives in #wikimedia-cloud and logs to https://wikitech.wikimedia.org/wiki/Labs_Server_Admin_Log

morebots:  Lives in #wikimedia-operations and logs to wikitech.wikimedia.org/wiki/Server_Admin_Log

qa-morebots: Lives in #wikimedia-releng and logs to https://wikitech.wikimedia.org/wiki/Release_Engineering/SAL

test-logbot:  Lives in #morebots-test and logs to www.mediawiki.org/wiki/Analytics/Server_Admin_Log
(This one is generally not running, just here as a dev tool.)

Example: restart the ops channel morebot

[edit]

Ssh to login.tools.wmflabs.org

become morebots
qstat
# now find the instance running on labs
qdel <id>
./labs.sh
jstart -N production-logbot /usr/lib/adminbot/adminlogbot.py --config ./confs/production-logbot.py

Deleting Twitter status

[edit]

Sometime people fill in spam on IRC which ends up on twitter account. To clear them up, you can use small python script that uses the twitter token stored in the configuration file.

$ become morebots
$ . ./venv/bin/activate
$ python
>>> import imp
>>> botconf = imp.load_source('botconf', './confs/production-logbot.py')
>>> import twitter
>>> api = twitter.Api(**botconf.twitter_api_params)
# List a status by id
>>> print api.getStatus(12345678)
# Delete it
>>> print api.DestroyStatus(12345678) 

See also

[edit]