obfuscurity / nagios-scripts Goto Github PK
View Code? Open in Web Editor NEWCustom scripts written for Nagios
License: MIT License
Custom scripts written for Nagios
License: MIT License
Calls of Graphite REST API from https://github.com/obfuscurity/nagios-scripts/blob/master/check_graphite#L95 and
https://github.com/obfuscurity/nagios-scripts/blob/master/check_graphite#L99 are redundant and double the load.
Proposed way:
response = JSON.parse(RestClient.get(URI.encode(url)))
if response.empty?
puts "UNKNOWN no data reported by Graphite"
exit EXIT_UNKNOWN
else
response.each do |cache|
When you query an inexistent metric in check_graphite, it queries in graphite the following URL:
http://graphite.server/render/?target=inexistent_metric&format=json&from=-5mins
Graphite answers with an empty JSON object:
[]
So JSON.parse(RestClient.get(URI.encode(url))).each doesn't parse anything, and the total value stays the same as initialized:
data["total"] = 0
I think in this case it should throw an exception, as this value will always be 0 and it doesn't make sense to monitor it.
I'm not a ruby developer, so I don't know what is the best way to accomplish this, that's why I'm not providing a pull request...
PD: I'm running graphite 0.9.12, but I think that behavious is common to all graphite versions.
please give examples to sending graphite date to nagios, how it work's and give commands for nagios it should very better
can you see my result and let me know where did i mistake.
viswanatha@viswanatha-desktop:/etc/nagios3$ python check_graphite.py -U http://127.0.0.1/render/?width=586&height=308&_salt=1349434980.323&from=-10minutes&target=carbon.agents.viswanatha-desktop-a.cpuUsage -w 2.25 -c 2.5
[1] 28798
[2] 28799
[3] 28800
[4] 28801
python: can't open file 'check_graphite.py': [Errno 2] No such file or directory
-w: command not found
[2] Done height=308
[1] Exit 2 python check_graphite.py -U http://127.0.0.1/render/?width=586
[2] Done height=308
[3]- Done _salt=1349434980.323
[4]+ Done from=-10minutes
viswanatha@viswanatha-desktop:~/nagios-plugins$ python check_graphite.py -U "http://127.0.0.1:8080/render/?width=586&height=308&_salt=1349434980.323&from=-10minutes&target=carbon.agents.viswanatha-desktop-a.cpuUsage" -w 2.25 -c 2.5
Usage: check_graphite.py [options]
check_graphite.py: error: no such option: -w
I'd like to distribute check_graphite to our hosts, but most of our hosts cannot run it due to various ruby incompatility and package issues. Would it be possible for you to produce a portable version that we can run on amzn_linux and centos boxes?
Hi,
Could you add a function in addition to sum and average that allows for giving thresholds for growth?
A trivial solution could be: threshold (given in percent of starting value) for ending value - starting value. I'm sure there are better solutions.
I just ran some tests with your plugins for integration into the Icinga 2 book and came up with the idea. I'd be happy to help with work on this issue when I have a bit of spare time.
Cheers,
Thomas
Greetings!
I've noticed option "-z", "--zero-on-error", "Return 0 on a graphite 500 error". I am curious why are these internal errors managed explicitly. Is it something check_graphite invokes on API backend or is it just a workaround for known API behaviour?
I am observing "500 Internal errors" on my Graphite installation + check_graphite unpleasantly often. What could be the reason?
Thank you, with regards .zp.
Hi,
Could you add a new function where you can give a value and the thresholds give warning and critical time for when the value is reached. Like value: 95, warning: 2d, critical: 1d to check for percentage of harddisk level.
Maybe I can help with implementing (see #25 for when and why)
Cheers,
Thomas
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.