/mysql_watcher/db_info
https://bitbucket.org/lindenlab/apiary/ · Python · 55 lines · 21 code · 6 blank · 28 comment · 1 complexity · 27b325be03cc6531f81ef6d82e0c2c5d MD5 · raw file
- #!/usr/bin/env python
- #
- # $LicenseInfo:firstyear=2010&license=mit$
- #
- # Copyright (c) 2010, Linden Research, Inc.
- #
- # Permission is hereby granted, free of charge, to any person obtaining a copy
- # of this software and associated documentation files (the "Software"), to deal
- # in the Software without restriction, including without limitation the rights
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- # copies of the Software, and to permit persons to whom the Software is
- # furnished to do so, subject to the following conditions:
- #
- # The above copyright notice and this permission notice shall be included in
- # all copies or substantial portions of the Software.
- #
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- # THE SOFTWARE.
- # $/LicenseInfo$
- #
- """
- Dump table info
- """
- import re
- import smtplib
- import socket
- import sys
- import time
- import traceback
- import os
- import logging
- import logging.handlers
- from types import *
- from dblibs.dbmonitor import DBMonitor
- from llbase import llsd
- USER = "foo"
- PASSWORD = "bar"
- if __name__ == "__main__":
- db_host = sys.argv[1]
- dbm = DBMonitor(db_host, USER, PASSWORD)
- info = dbm.getTableInfo()
- f = open("db_info_%s.llsd" % db_host, "w")
- f.write(str(llsd.LLSD(info)))
- f.close()