Skip to content

Instantly share code, notes, and snippets.

@djhuahao
djhuahao / zbx_template_jmx_activemq.xml
Last active October 26, 2015 17:11 — forked from Cromeshnic/zbx_template_jmx_activemq.xml
Zabbix 2.0 template for ActiveMQ with JMX LLD for brokers and destinations. Feel free to contribute.
<?xml version="1.0" encoding="UTF-8"?>
<!--
by Semyon Koshechkin (c) 2013
https://github.com/Cromeshnic
Zabbix ActiveMQ monitoring template with LLD support for:
- Brokers
- Topics
- Queues
<?xml version="1.0" encoding="UTF-8"?>
<!--
Macros to be defined
* JMX_USERNAME
* JMX_PASSWORD
* HTTP_PORT (mandatory)
* HTTPS_PORT (mandatory)
* AJP_PORT (mandatory)
@djhuahao
djhuahao / JMXItemChecker.java
Last active August 29, 2015 14:28 — forked from Cromeshnic/JMXItemChecker.java
zabbix_java JMX LLD patch. Usage example: jmx.discovery["org.apache.activemq:BrokerName=*,Type=Queue,Destination=*"]
/*
** Zabbix
** Copyright (C) 2000-2011 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
@djhuahao
djhuahao / zbx_template_jmx_common.xml
Last active August 29, 2015 14:28 — forked from Cromeshnic/zbx_template_jmx_common.xml
Macros: {$JMX_USERNAME} {$JMX_PASSWORD}
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2013-10-07T06:23:45Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
@djhuahao
djhuahao / git_toturial
Created June 23, 2016 05:14 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库
@djhuahao
djhuahao / lld - ss
Created September 29, 2018 08:24 — forked from Jerry-Fix/lld - ss
Replace netstat with ss to implement the low level discovery for zabbix
#!/bin/bash
lines=$(sudo ss -lp | grep $1 | awk '{print $3}' | cut -d: -f2 | sort | wc -l)
if [ "$1" == "mongod" ]
then
portarray=(`sudo ss -lp | grep $1 | awk '{print $3}' | cut -d: -f2 | sort | head -n $(($lines/2)) 2>/dev/null`)
else
portarray=(`sudo ss -lp | grep $1 | awk '{print $3}' | cut -d: -f2 | sort 2>/dev/null`)
fi