Comments (5)
Sorry. I've no idea how I was never e-mailed about this until now.
I think @geertn is right - there's certainly a bad assumption on my part that should you select a type to be checked you have at least one of it. However, I supect it should be more like:
--- haproxyng
+++ munin-plugins/haproxyng
@@ -585,8 +585,8 @@
++$count;
$total+=$data{$service}{'servers'}{$server}{'timing'}{'total'};
}
- $values{$service} = ($total/$count);
+ $values{$service} = ($count > 0 ? $total/$count : 0);
}
mg_fetch(TYPE_BACKEND, ['timing'], \%values);
This at least ensures that $values{$service}
is set for any following code and required checks are properly conducted against the service. I'll try and fix it on the weekend.
Todo
- Resolve divide-by-zero error in line 589.
- Check all divisions for incorrect assumptions in counts or divisors.
from monitoring-munin-haproxy.
if count start at 1, count would be 2 for one service in one server. Is that correct ?
what about 588 $count=1 if $count==0;
?
from monitoring-munin-haproxy.
My scripting is not very good, but after changing to 1, it is fixed my
issues.
On Thu, Apr 14, 2016 at 10:20 AM, flintforge [email protected]
wrote:
if count start at 1, count will be 2 for one service in one server. Is
that correct ?
what about 588 $count=1 if $count==0; ?—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#1 (comment)
Thanks
Eric Zhang
Skype: eric.zhang1008
Mobile: 008615000723581
Email: [email protected]
You are warmly welcome to visit my website: http://www.itopslife.com, the
best practice for OPERATION.
from monitoring-munin-haproxy.
Do you happen to have a stats listener configured? That will generate stats for a backend without any servers resulting in the error. The following quick fix made it work for me:
otalb0 20161108-17:15:58 /opt # diff -u haproxyng munin-plugins/haproxyng
--- haproxyng 2016-11-08 17:15:58.877352196 +0100
+++ munin-plugins/haproxyng 2016-11-08 17:15:11.716604569 +0100
@@ -585,8 +585,9 @@
++$count;
$total+=$data{$service}{'servers'}{$server}{'timing'}{'total'};
}
-
- $values{$service} = ($total/$count);
+ if($count != 0){
+ $values{$service} = ($total/$count);
+ }
}
mg_fetch(TYPE_BACKEND, ['timing'], \%values);
from monitoring-munin-haproxy.
I've added a commit which should prevent this error, and I cannot see anywhere else where I use a divisor, so which should be the only place that needs a check. Please feel free to test the version in PR #3 and let me know if this fixes your problem.
from monitoring-munin-haproxy.
Related Issues (9)
- haproxyng working with munin-run but not in munin-node
- Multi-process support?
- incomplete graph data for overlapping frontend and backend names
- Argument "" isn't numeric in addition (+) HOT 3
- Do not work for me HOT 1
- Issue with Graphs HOT 3
- Documentation HOT 1
- Haproxyng graphs sometimes throwing 404 errors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monitoring-munin-haproxy.