侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

sdfsdfsdfsdf

2022-12-10 星期六 / 0 评论 / 0 点赞 / 34 阅读 / 2395 字

#安装所需的依赖包yum-yinstallnet-snmpnet-snmp-develntpdatelibxml2libxml2-develnet-snmp-develcurlcurl-develyu

.

#安装所需的依赖包yum -y install net-snmp net-snmp-devel ntpdate libxml2 libxml2-devel net-snmp-devel curl curl-develyum -y install mysql-develyum -y install gccyum -y install vim#安装ntpdateyum -y install ntpdate#同步服务器跟客户端的时间,避免日志出现时间错乱ntpdate 1.cn.pool.ntp.org#配置编译,指定安装目录,编译server与agent./configure /--prefix=/usr/local/zabbix /--enable-server /--enable-agent /--with-mysql /--with-net-snmp /--with-libcurl /--with-lib
class ReportForm:    def __init__(self):        #打开数据库连接        self.conn = MySQLdb.connect(host=dbhost,user=dbuser,passwd=dbpasswd,db=dbname,port=dbport,charset='utf8')        self.cursor = self.conn.cursor(cursorclass=MySQLdb.cursors.DictCursor)    def getGraphID(self,HostName,GraphsName):        #获取graphid        sql = 'select distinct graphs_items.graphid from items join graphs_items on graphs_items.itemid=items.itemid join graphs on graphs_items.graphid=graphs.graphid  where items.hostid=(select hostid from hosts where host="%s") and graphs.name="%s"' % (HostName,GraphsName)        if self.cursor.execute(sql):            graphid = self.cursor.fetchone()['graphid']        else:            graphid = None        return graphid    def __del__(self):        #关闭数据库连接        self.cursor.close()        self.conn.close()


.

广告 广告

评论区