Vraag


Acties:
  • 0 Henk 'm!

  • ge-flopt
  • Registratie: Februari 2001
  • Laatst online: 22:53
Ik ben al een paar dagen aan het zoeken en ik ben waarschijnlijk er al een paar keer voorbij gekomen denk ik, maar het kwartje valt dan niet.

Ik meet het ruimte gebruik van mijn disk op mijn RPI. Dit doe ik simpel door een script uit te voeren die met df mijn gegeven retourneert. Op zich werkt alles, maar alleen loop ik steeds tegen het volgende aan:
De daily graph is keurig in GB's maar de weekly, monthly en yearly worden genoteerd in MB. De daily geeft dus keurig 480GB terug terwijl de rest alles als 480000MB.

Ik denk dat ik dus een parameter verkeerd heb staan, maar weet even niet welke het is.

Title[RootDiskSpace]: RootDiskSpace
PageTop[RootDiskSpace]: <H1>Root Disk Space</H1>
Options[RootDiskSpace]: absolute,gauge,growright,nopercent
Target[RootDiskSpace]: `sh /data/mrtg/rootdisk.sh`
MaxBytes[RootDiskSpace]: 500000000
YLegend[RootDiskSpace]: Space
LegendI[RootDiskSpace]: Total diskspace
LegendO[RootDiskSpace]: Used diskspace
ShortLegend[RootDiskSpace]: B
kMG[RootDiskSpace]: m,G
Unscaled[RootDiskSpace]:n

PS excuses voor de topic titel, ik denk dat er iets is fout gegaan met het aanmaken ervan.

[ Voor 8% gewijzigd door ge-flopt op 02-03-2018 20:18 ]

Alle reacties


Acties:
  • 0 Henk 'm!

  • DJMaze
  • Registratie: Juni 2002
  • Niet online
Bedoel je zoiets?
code:
1
2
3
4
5
6
7
8
9
10
11
12
[geflopt@local ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        7.8G     0  7.8G   0% /dev
tmpfs           7.9G   21M  7.8G   1% /dev/shm
tmpfs           7.9G  1.3M  7.9G   1% /run
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/sdb4       109G   13G   92G  12% /
tmpfs           7.9G  168K  7.9G   1% /tmp
/dev/sdb2       477M  153M  295M  35% /boot
/dev/sda1       235G  112G  111G  51% /home
/dev/sdb1       200M  9.4M  191M   5% /boot/efi
tmpfs           1.6G   32K  1.6G   1% /run/user/500

Maak je niet druk, dat doet de compressor maar


Acties:
  • 0 Henk 'm!

  • ge-flopt
  • Registratie: Februari 2001
  • Laatst online: 22:53
Dit is het script:
#!/bin/bash
DATA=`df -m / |tail -1`
FIRST=`echo $DATA | cut -f2 -d" "`
SECOND=`echo $DATA | cut -f3 -d" "`
echo $FIRST
echo $SECOND
echo 0
echo 0

Acties:
  • +1 Henk 'm!

  • DJMaze
  • Registratie: Juni 2002
  • Niet online
$ df --help |:(
Usage: df [OPTION]... [FILE]...
Show information about the file system on which each FILE resides,
or all file systems by default.

Mandatory arguments to long options are mandatory for short options too.
-a, --all include pseudo, duplicate, inaccessible file systems
-B, --block-size=SIZE scale sizes by SIZE before printing them; e.g.,
'-BM' prints sizes in units of 1,048,576 bytes;
see SIZE format below

--direct show statistics for a file instead of mount point
-h, --human-readable print sizes in powers of 1024 (e.g., 1023M)
-H, --si print sizes in powers of 1000 (e.g., 1.1G)
-i, --inodes list inode information instead of block usage
-k like --block-size=1K
-l, --local limit listing to local file systems
--no-sync do not invoke sync before getting usage info (default)
--output[=FIELD_LIST] use the output format defined by FIELD_LIST,
or print all fields if FIELD_LIST is omitted.
-P, --portability use the POSIX output format
--sync invoke sync before getting usage info
--total elide all entries insignificant to available space,
and produce a grand total
-t, --type=TYPE limit listing to file systems of type TYPE
-T, --print-type print file system type
-x, --exclude-type=TYPE limit listing to file systems not of type TYPE
-v (ignored)
--help display this help and exit
--version output version information and exit

code:
1
2
3
$ df -mBG /
Filesystem     1G-blocks  Used Available Use% Mounted on
/dev/sdb4           109G   13G       92G  12% /

Maak je niet druk, dat doet de compressor maar


Acties:
  • 0 Henk 'm!

  • ge-flopt
  • Registratie: Februari 2001
  • Laatst online: 22:53
Dus dat geeft de volgende verschillen?
Afbeeldingslocatie: http://mrtg.project34.net/images/rootdiskspace-day.png
Afbeeldingslocatie: http://mrtg.project34.net/images/rootdiskspace-month.png
Ik lever aan MRTG toch door het zelfde gegevens aan?
Het gaat dus om de Y as.

Ik geef in de CFG file: kMG[RootDiskSpace]: m,G en dus gaat hij de data verwerken als MB's.

[ Voor 22% gewijzigd door ge-flopt op 02-03-2018 20:46 ]