Projet

Général

Profil

Révision 144f333c

ID144f333cf0a25666189fc62f041c2e936da318f4
Parent ee4f4ce2
Enfant 3790d201

Ajouté par Younes Ichiche il y a presque 4 ans

use integers + fix bad blocks to be 5% max then the mikrotik needs to be reinstalled

Voir les différences:

plugins/router/mikrotik_system
172 172
      print "graph_title bad blocks " "'"$name"'";
173 173
      print "graph_vlabel %";
174 174
      print "graph_category mikrotik";
175
      print "graph_args -l 0 --upper-limit 100";
175
      print "graph_args -l 0 --upper-limit 5";
176 176
      print "bad_blocks.label bad_blocks";
177
      print "bad_blocks.warning 50";
178
      print "bad_blocks.critical 90";
177
      print "bad_blocks.warning 3;
178
      print "bad_blocks.critical 4";
179 179
      print "graph_info Percentage of Bad Blocks."
180 180
      }'
181 181
  done <<< "$data"
......
358 358
  while read -r line; do
359 359
    echo "$line" | awk '/total-memory:/{
360 360
        gsub(/MiB/,"",$2);
361
        print "total_memory.value " $2
361
        printf "total_memory.value %d\n", $2
362 362
      }'
363 363
  done <<< "$data"
364 364
  while read -r line; do
365 365
    echo "$line" | awk '/free-memory:/{
366 366
        gsub(/MiB/,"",$2);
367
        print "free_memory.value " $2
367
        printf "free_memory.value %d\n", $2
368 368
      }'
369 369
  done <<< "$data"
370 370
  # berechne used-memory
371 371
  # gesamt + frei = benutzt
372
  echo used_memory.value "$(echo $mem_total $mem_free | awk '{print ($1 - $2)}')"
372
  printf "used_memory.value %.0f\n" "$(echo $mem_total $mem_free | awk '{print ($1 - $2)}')"
373 373
}
374 374

  
375 375
function get_disk_label {
......
392 392
  while read -r line; do
393 393
    echo "$line" | grep KiB | awk '/free-hdd-space:/ {
394 394
      gsub(/KiB/,"",$2)
395
      print "free_disk.value " $2*1024 }'
395
      printf "free_disk.value %d\n", $2*1024 }'
396 396
    echo "$line" |  grep MiB | awk '/free-hdd-space:/ {
397 397
      gsub(/MiB/,"",$2)
398
      print "free_disk.value " $2*1048576}'
398
      printf "free_disk.value %d\n", $2*1048576}'
399 399
    echo "$line" | grep KiB | awk '/total-hdd-space:/ {
400 400
      gsub(/KiB/,"",$2)
401
      print "total_disk.value " $2*1024 }'
401
      printf "total_disk.value %d\n", $2*1024 }'
402 402
    echo "$line" |  grep MiB | awk '/total-hdd-space:/ {
403 403
      gsub(/MiB/,"",$2)
404
      print "total_disk.value " $2*1048576 }'
404
      printf "total_disk.value %d\n", $2*1048576 }'
405 405
  done <<< "$data"
406 406
}
407 407

  

Formats disponibles : Unified diff