jamesc/nagios-plugins-rabbitmq — pull request #8 by omerhasan (2012-06-05 00:43:16+00:00)
Title: Calculate Percentages Correctly

Hello,

The current plugin does not calculate percentages correctly for Memory at all. I believe it is more apparent on RabbitMQ installations with memory larger than 4GB but I haven't confirmed that. I've made the calculation simpler while maintaining two decimal places.

Actual Values:
```
mem_used: 9533304584,
mem_limit: 10102652928,

proc_used: 2978,
proc_total: 1048576,

fd_used: 227,
fd_total: 24576,

```

Before:
```
RABBITMQ_SERVER OK - Memory OK (4.37%) Process OK (0.28%) FD OK (0.92%) | Memory=4.37%;80;90 Process=0.28%;80;90 FD=0.92%;80;90
```
After:
```
RABBITMQ_SERVER CRITICAL - Memory CRITICAL (94.37%), Process OK (0.28%) FD OK (0.92%) | Memory=94.37%;60;80 Process=0.28%;60;80 FD=0.92%;60;80
```

Thank you.