radoondas / jmxproxybeat Goto Github PK
View Code? Open in Web Editor NEWJmxProxyBeat - Simple beat for Tomcat JMX exposed over JmxProxyServlet to HTTP
License: Apache License 2.0
JmxProxyBeat - Simple beat for Tomcat JMX exposed over JmxProxyServlet to HTTP
License: Apache License 2.0
It would be good to be able to set the bean.hostname in the config, otherwise it is 127.0.0.1:8080 (the URL).
Is especially useful if you run jmxproxybeat on many Tomcat hosts and aggregate in a central ES server.
Hi,
I am using
Elastic search - 6.2.2
Logstash - 6.2.2
Kibana - 6.2.2.
Installed and made the jmxproxybeat and pushing the details directly to the elasticsearch. Previously I got an error regarding the template upload issue. So I manually uploaded the template using the 'curl'. That issue was resolved. But while trying to push the data, the following error is prompting,
2018/03/22 06:25:45.461945 output.go:174: INFO Template already exists and will not be overwritten.
2018/03/22 06:25:45.462596 bulkapi.go:131: DBG Sending bulk request to http://10.10.114.149:9200/_bulk
2018/03/22 06:25:45.510602 client.go:147: ERR Failed to perform any bulk index operations: 406 Not Acceptable
I read that the issue may be regarding the content type and from elasticsearch 6.X onwards, the content type header is set to true and there is no way to make it disable. When I raised the issue with elasticbeat, they adviced to raise with the beat!
Request you to advice! I am really stuck!
Thanks in advance!
Vishnu
To ease the demonizing of jmxproxybeat it would be good to add example file for it
jmxproxybeat.initd:
#!/bin/bash
#
# jmxproxybeat jmxproxy shipper
#
# chkconfig: 2345 98 02
# description: Starts and stops a single jmxproxybeat instance on this system
#
### BEGIN INIT INFO
# Provides: jmxproxybeat
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Jmxproxybeat analyzes Tomcat JMX Servlet metrics.
# Description: Jmxproxybeat is a shipper for Tomcat Metrics to ElasticSearch.
# Please see: https://github.com/radoondas/jmxproxybeat
### END INIT INFO
PATH=/usr/bin:/sbin:/bin:/usr/sbin
export PATH
[ -f /etc/sysconfig/jmxproxybeat ] && . /etc/sysconfig/jmxproxybeat
pidfile=${PIDFILE-/var/run/jmxproxybeat.pid}
BIN_NAME="jmxproxybeat"
agent=${BEATS_AGENT-/usr/share/jmxproxybeat/${BIN_NAME}}
args="-c /etc/jmxproxybeat/jmxproxybeat.yml -path.home /usr/share/jmxproxybeat -path.data /var/lib/jmxproxybeat -path.logs /var/log/jmxproxybeat"
test_args="-e -configtest"
RETVAL=0
# Source function library.
. /etc/rc.d/init.d/functions
# Determine if we can use the -p option to daemon, killproc, and status.
# RHEL < 5 can't.
if status | grep -q -- '-p' 2>/dev/null; then
daemonopts="--pidfile $pidfile"
pidopts="-p $pidfile"
fi
test() {
$agent $args $test_args
}
start() {
echo -n $"Starting jmxproxybeat: "
test
if [ $? -ne 0 ]; then
echo
exit 1
fi
daemon $daemonopts "$agent $args &"
RETVAL=$?
[ $RETVAL -eq "0" ] && touch /var/lock/subsys/$BIN_NAME
pid=`ps -A | grep ${BIN_NAME} | cut -d " " -f1`
if [ -n "$pid" ]; then
echo $pid > "$pidfile"
fi
echo
return $RETVAL
}
stop() {
echo -n $"Stopping jmxproxybeat: "
[ -f /var/lock/subsys/$BIN_NAME ] || return 0
killproc $agent
echo
rm -f $pidfile
rm -f /var/lock/subsys/$BIN_NAME
RETVAL=$?
echo
}
restart() {
test
if [ $? -ne 0 ]; then
return 1
fi
stop
start
}
rh_status() {
status $pidopts $agent
RETVAL=$?
return $RETVAL
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
status)
rh_status
;;
configtest)
test
;;
*)
echo $"Usage: $0 {start|stop|status|configtest|restart|condrestart}"
exit 1
esac
exit $RETVAL
jmxproxybeat.systemd:
[Unit]
Description=JMXProxyBeat Service
After=syslog.target network.target
[Service]
Type=simple
Restart=always
RestartSec=3
User=root
PIDFile=/var/run/jmxproxybeat.pid
ExecStart=/usr/share/jmxproxybeat/jmxproxybeat -c /etc/jmxproxybeat/jmxproxybeat.yml -path.home /usr/share/jmxproxybeat -path.data /var/lib/jmxproxybeat -path.logs /var/log/jmxproxybeat
[Install]
WantedBy=multi-user.target
//TODO: This requires lots of tuning!!
re = regexp.MustCompile("\\d*(\\.\\d+)?$")
if matches := re.FindStringSubmatch(responseBody); matches != nil {
respV, err := strconv.ParseFloat(matches[0], 64)
//TODO: test for empty string!
if err != nil {
return 0.0, err
}
respValue = respV
}
This code only can get numbers, and some times not correct.
{"@timestamp":"2017-09-19T07:23:02.620Z","bean":{"attribute":"minTime","hostname":"127.0.0.1:8080","name":"Catalina:j2eeType=Servlet,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none","value":9223372036854776000},"beat":{"hostname":"my-PC2","name":"my-PC2"},"type":"jmx"}
OK - Attribute get 'Catalina:j2eeType=Servlet,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none' - minTime = 9223372036854775807
Thanks
Update Jmxproxybeat to libbeat v6
To make sure beat is working against Elasticsearch v5 and v6 I have to upgrade jmxproxybeat to Libbeat v 6. Plan to use latest version of Libbeat.
One of the results will be new release and no need to compile this beat any more.
Would be great if you can supply a dashboard / visualizations for jmxproxybeat with the project, like metricbeat modules do.
Update GO to version 1.7.3
xgo is needed to build the packages. It's not documented in the README. Which fork / version of xgo do you use?
Update Go to 1.7.1
Update GO to 1.6.3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.