Ad Widget

Collapse

Apache monitoring template - round Request Per Second value to integer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Glukas
    Junior Member
    • Nov 2021
    • 17

    #1

    Apache monitoring template - round Request Per Second value to integer

    Hi There,

    I am looking for a way to get better readable output of Apache ReqPerSec value, which is shown by template as integer (float) and mostly shows numbers like this - ReqPerSec: .146931
    I'd like it to show as integer only, similar to ceil (value) ​function, so that in example above it will output number 1.
    Can someone explain me how can I use this function properly there?

    Thanks!
  • Glukas
    Junior Member
    • Nov 2021
    • 17

    #2
    Just in case someone interested in it too - in the meantime found some suitable solution myself.
    As I mentioned, Apache template "Apache: Requests per second" check set to use Numeric (float) information type for some reason.
    If you'll change it to Numeric (unsigned), the value will be rounded to one number after the dot, which is not exactly what did I wanted, but way closer to it.
    Showing this value on Top Hosts widget for your webservers you will see 60.4 requests per second coming to your webserver instead of 60.4123 showed by default.

    I still will be grateful for advice on how to make it rounded to integer only.

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #3
      Add JS preprocessing and do whatever you need with that number...
      This JavaScript tutorial explains how to use the math function called ceil() with syntax and examples. In JavaScript, ceil() is a function that is used to return the smallest integer value that is greater than or equal to a number. In other words, the ceil() function rounds a number up and returns an integer value.

      Comment

      Working...