Query Commands Supported by Storage Daemon

Here are some example for the query commands supported by the storage daemon:

  • diskusage return the amount of free space for each different Storage device

  • filename return the list of files or directories for a given path

  • dircreate create a directory into a given directory

  • diskperf show read and write performance for each different archive directory

  • scsi_device show a list of all tape drives and tape libraries

These commands are all compatible with api=2 and JSON format using api_opts=j.

The errors are reported via 3 fields:

  • error there is one error field per item and one for the command.

  • error_count is the total number of errors, usefull when you have multiple items.

  • error_msg is the error message that is optional, you can have one message per item and one for the command.

The diskusage command has the following format:

*.query plugin=core: parameter=diskusage storage=File

disks: [

disk_usage=/
mount_point=/
free_space=158037155840
total_space=268246822912
fstype=ext4


disk_usage=/boot/efi
mount_point=/boot/efi
free_space=529436672
total_space=535805952
fstype=vfat
]

error=0
error_count=0

The filename command has the following format:

*.query plugin="core: dirname=/home/bac/workspace/bee/regress" parameter=filename storage=File

dirname=/home/bac/workspace/bee/regress
files: [


filename=test_duration
st_mode=33277
st_size=378


filename=nightly-all
st_mode=33261
st_size=834

...

filename=run.py
st_mode=33188
st_size=158


filename=Makefile
st_mode=33188
st_size=1542
]

error=0
error_count=0

It is possible to list only directories using the option opt=d:

*.query plugin="core: dirname=/home/bac/workspace/bee/regress opt=d" parameter=filename storage=File

dirname=/home/bac/workspace/bee/regress
files: [


filename=tests
st_mode=16877
st_size=36864


filename=scripts
st_mode=16877
st_size=20480


filename=bin
st_mode=16888
st_size=4096


filename=weird-files2
st_mode=16877
st_size=4096

...

filename=weird-files
st_mode=16877
st_size=4096
]

error=0
error_count=0

Errors are reported as expected:

*.query plugin="core: dirname=\"/root/denied path\"" parameter=filename storage=File

error=1
error_count=1
dirname=/root/denied path
error_msg=Permission denied

The dircreate command has the following format:

*.query plugin="core: \"dirname=/tmp/zoro\"" parameter=dircreate storage=File

dirname=/tmp/zoro
error=0
error_count=0

Errors are reported as expected:

*.query plugin="core: \"dirname=/tmp/zoro\"" parameter=dircreate storage=File
dirname=/tmp/zoro
error=1
error_count=1
error_msg=File exists

The diskperf command has the following format:

*.query plugin="core:" parameter=diskperf storage=File

parameter=diskperf
archives: [


diskperf=FileStorage
archive=/home/bac/workspace/bee/regress/tmp
bytes=1073741824
duration_read=947773
duration_write=1237260
read=1132910331
write=867838468
unit=b/s
cache_disabled=fadvise


diskperf=FileStorage1
archive=/home/bac/workspace/bee/regress/tmp/File1
bytes=1073741824
duration_read=955764
duration_write=1205660
read=1123438237
write=890584264
unit=b/s
cache_disabled=fadvise
]

error=0
error_count=0

You can limit the performance test to only one archive directory.

*.query plugin="core: archive=/home/bac/workspace/bee/regress/tmp" parameter=diskperf storage=File


parameter=diskperf
archives: [


diskperf=FileStorage
archive=/home/bac/workspace/bee/regress/tmp
bytes=1073741824
duration_read=962318
duration_write=1214635
read=1115786906
write=884003691
unit=b/s
cache_disabled=fadvise
]

error=0
error_count=0

Errors are reported as expected:

*.query plugin="core: archive=/dont_exist_2311" parameter=diskperf storage=File

parameter=diskperf
archives: [
]

error_msg=archive directory not found: /dont_exist_2311
error=1
error_count=1

The scsi_device command has the following format:

*.query plugin="core: filter=any" parameter=scsi_device storage=File

scsi: [

scsi_device=/dev/sda
scsi_id=[0:0:0:0]
type=disk
vendor=Msft
model=Virtual Disk
revision=1.0
device_ctr=/dev/sg0


scsi_device=/dev/sr0
scsi_id=[0:0:0:1]
type=cd/dvd
vendor=Msft
model=Virtual DVD-ROM
revision=1.0
device_ctr=/dev/sg1
]

error=0
error_count=0

The filter option is used to filter the type of devices, any shows all scsi devices. When not specified tape and mediumx (aka tape library) are shown. Other known filter are disk and cd/dvd:

*.query plugin="core: filter=disk" parameter=scsi_device storage=File

scsi: [

scsi_device=/dev/sda
scsi_id=[0:0:0:0]
type=disk
vendor=Msft
model=Virtual Disk
revision=1.0
device_ctr=/dev/sg0
]

error=0
error_count=0

If you use a bad filter or dont have any device of the given type:

*.query plugin="core:" parameter=scsi_device storage=File

scsi: [
]

error=0
error_count=0

Go back to the Technical Reference for Storage Daemon.