Projet

Général

Profil

Révision d10c1198

IDd10c11989b39aec62c81f301156089bb1fca49b9
Parent b392cacc
Enfant 0d8f8309

Ajouté par HaseHarald il y a plus de 4 ans

[btrfs_device_stats] Allow for configuring warning values as a global and individual value.

Voir les différences:

plugins/disk/btrfs_device_stats
54 54

  
55 55

  
56 56
import btrfs
57
import os
57 58
import sys
58 59

  
59 60

  
......
77 78
    print("")
78 79

  
79 80
    devices = fs.devices()
81
    warning = os.getenv('warning', default = 1)
80 82
    for this_device in devices:
81 83
        this_dev_info = fs.dev_info(this_device.devid)
82 84
        this_dev_name = this_dev_info.path.replace('/dev/', '')
......
88 90
        print("graph_info This graph shows stats of devices used by btrfs")
89 91

  
90 92
        print("corruption_errs.label Corruption Errors")
91
        print("corruption_errs.warning 1")
93
        print("corruption_errs.warning " + os.getenv('corruption_errs_warning', default = str(warning)))
92 94
        print("flush_errs.label Flush Errors")
93
        print("flush_errs.warning 1")
95
        print("flush_errs.warning " + os.getenv('flush_errs_warning', default = str(warning)))
94 96
        print("generation_errs.label Generation Errors")
95
        print("generation_errs.warning 1")
97
        print("generation_errs.warning " + os.getenv('generation_errs_warning', default = str(warning)))
96 98
        print("read_errs.label Read Errors")
97
        print("read_errs.warning 1")
99
        print("read_errs.warning " + os.getenv('read_errs_warning', default = str(warning)))
98 100
        print("write_errs.label Write Errors")
99
        print("write_errs.warning 1")
101
        print("write_errs.warning " + os.getenv('write_errs_warning', default = str(warning)))
100 102
        print("nr_items.label Nr. of Items")
101 103
        print("flags.label Nr. of Flags")
102
        print("flags.warning 1")
104
        print("flags.warning " + os.getenv('flags_warning', default = str(warning)))
103 105

  
104 106
        print("")
105 107

  

Formats disponibles : Unified diff