We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I met an issue then head not works with mjson.tool. We have replaced it with following code
awk 'BEGIN { i=0 } { ++i; if (i<=30) { print $0; } }'
Where 30 is amount of string have to be selected.
In the end I've got following logstashzabbix.sh script #!/bin/bash case $1 in status ) initctl status logstash | grep -q running && echo 1 || echo 0 ;; heap_bytes ) curl -s http://localhost:9600//_node/stats/jvm | python -mjson.tool | grep "heap_used_in_bytes | awk '{ print $2 }' | sed 's/,//' ;; heap_percent ) curl -s http://localhost:9600//_node/stats/jvm | python -mjson.tool | grep "heap_used_percent | awk '{ print $2 }' | sed 's/,//' ;; heap_max ) curl -s http://localhost:9600//_node/stats/jvm | python -mjson.tool | grep "heap_max_in_bytes | awk '{ print $2 }' | sed 's/,//' ;; events_in ) curl -s http://localhost:9600//_node/stats/pipeline | python -mjson.tool | awk 'BEGIN { i=0 } { ++i; if (i<=10) { print $0; } }' | grep "in | awk '{ print $2 }' | sed 's/,//' ;; events_filtered ) curl -s http://localhost:9600//_node/stats/pipeline | python -mjson.tool | awk 'BEGIN { i=0 } { ++i; if (i<=10) { print $0; } }' | grep "filtered | awk '{ print $2 }' | sed 's/,//' ;; events_out ) curl -s http://localhost:9600//_node/stats/pipeline | python -mjson.tool | awk 'BEGIN { i=0 } { ++i; if (i<=11) { print $0; } }' | grep "out | awk '{ print $2 }' | sed 's/,//' ;; failures ) curl -s http://localhost:9600//_node/stats/pipeline | python -mjson.tool | grep "failures | awk '{ print $2 }' | sed 's/,//' ;; esac
`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I met an issue then head not works with mjson.tool.
We have replaced it with following code
Where 30 is amount of string have to be selected.
In the end I've got following logstashzabbix.sh script
#!/bin/bash
case $1 in
status )
initctl status logstash | grep -q running && echo 1 || echo 0 ;;
heap_bytes )
curl -s http://localhost:9600//_node/stats/jvm | python -mjson.tool | grep "heap_used_in_bytes | awk '{ print $2 }' | sed 's/,//' ;;
heap_percent )
curl -s http://localhost:9600//_node/stats/jvm | python -mjson.tool | grep "heap_used_percent | awk '{ print $2 }' | sed 's/,//' ;;
heap_max )
curl -s http://localhost:9600//_node/stats/jvm | python -mjson.tool | grep "heap_max_in_bytes | awk '{ print $2 }' | sed 's/,//' ;;
events_in )
curl -s http://localhost:9600//_node/stats/pipeline | python -mjson.tool | awk 'BEGIN { i=0 } { ++i; if (i<=10) { print $0; } }' | grep "in | awk '{ print $2 }' | sed 's/,//' ;;
events_filtered )
curl -s http://localhost:9600//_node/stats/pipeline | python -mjson.tool | awk 'BEGIN { i=0 } { ++i; if (i<=10) { print $0; } }' | grep "filtered | awk '{ print $2 }' | sed 's/,//' ;;
events_out )
curl -s http://localhost:9600//_node/stats/pipeline | python -mjson.tool | awk 'BEGIN { i=0 } { ++i; if (i<=11) { print $0; } }' | grep "out | awk '{ print $2 }' | sed 's/,//' ;;
failures )
curl -s http://localhost:9600//_node/stats/pipeline | python -mjson.tool | grep "failures | awk '{ print $2 }' | sed 's/,//' ;;
esac
`
The text was updated successfully, but these errors were encountered: