diff options
-rw-r--r-- | plugins-root/check_icmp.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 915710b..12fb7b7 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c | |||
@@ -1322,7 +1322,27 @@ finish(int sig) | |||
1322 | } | 1322 | } |
1323 | 1323 | ||
1324 | if (host->icmp_recv>1) { | 1324 | if (host->icmp_recv>1) { |
1325 | /* | ||
1326 | * This algorithm is probably pretty much blindly copied from | ||
1327 | * locations like this one: https://www.slac.stanford.edu/comp/net/wan-mon/tutorial.html#mos | ||
1328 | * It calucates a MOS value (range of 1 to 5, where 1 is bad and 5 really good). | ||
1329 | * According to some quick research MOS originates from the Audio/Video transport network area. | ||
1330 | * Whether it can and should be computed from ICMP data, I can not say. | ||
1331 | * | ||
1332 | * Anyway the basic idea is to map a value "R" with a range of 0-100 to the MOS value | ||
1333 | * | ||
1334 | * MOS stands likely for Mean Opinion Score ( https://en.wikipedia.org/wiki/Mean_Opinion_Score ) | ||
1335 | * | ||
1336 | * More links: | ||
1337 | * - https://confluence.slac.stanford.edu/display/IEPM/MOS | ||
1338 | */ | ||
1325 | host->jitter=(host->jitter / (host->icmp_recv - 1)/1000); | 1339 | host->jitter=(host->jitter / (host->icmp_recv - 1)/1000); |
1340 | |||
1341 | /* | ||
1342 | * Take the average round trip latency (in milliseconds), add | ||
1343 | * round trip jitter, but double the impact to latency | ||
1344 | * then add 10 for protocol latencies (in milliseconds). | ||
1345 | */ | ||
1326 | host->EffectiveLatency = (rta/1000) + host->jitter * 2 + 10; | 1346 | host->EffectiveLatency = (rta/1000) + host->jitter * 2 + 10; |
1327 | 1347 | ||
1328 | if (host->EffectiveLatency < 160) { | 1348 | if (host->EffectiveLatency < 160) { |
@@ -1331,6 +1351,8 @@ finish(int sig) | |||
1331 | R = 93.2 - ((host->EffectiveLatency - 120) / 10); | 1351 | R = 93.2 - ((host->EffectiveLatency - 120) / 10); |
1332 | } | 1352 | } |
1333 | 1353 | ||
1354 | // Now, let us deduct 2.5 R values per percentage of packet loss (i.e. a | ||
1355 | // loss of 5% will be entered as 5). | ||
1334 | R = R - (pl * 2.5); | 1356 | R = R - (pl * 2.5); |
1335 | 1357 | ||
1336 | if (R < 0) { | 1358 | if (R < 0) { |