EasyManua.ls Logo

Oracle ZFS Storage Appliance

Oracle ZFS Storage Appliance
650 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Using the List Function
The message about pseudo-terminal allocation is due to the ssh client; the issue that this
message refers to can be dealt with by specifying the "-T" option to ssh.
Using the List Function
In a context with dynamic children, it can be very useful to iterate over those children
programmatically. This can be done by using the list function, which returns an array of
dynamic children.
1.
The following example script iterates over every share in every project, printing
out the amount of space consumed and space available:
script
run('shares');
projects = list();
for (i = 0; i < projects.length; i++) {
run('select ' + projects[i]);
shares = list();
for (j = 0; j < shares.length; j++) {
run('select ' + shares[j]);
printf("%s/%s %1.64g %1.64g\n", projects[i], shares[j],
get('space_data'), get('space_available'));
run('cd ..');
}
run('cd ..');
}
2.
Here is the output of running the script, assuming it were saved to a file named
"space.aksh":
% ssh root@koi < space.aksh
Password:
admin/accounts 18432 266617007104
admin/exports 18432 266617007104
admin/primary 18432 266617007104
admin/traffic 18432 266617007104
admin/workflow 18432 266617007104
aleventhal/hw_eng 18432 266617007104
bcantrill/analytx 1073964032 266617007104
bgregg/dashbd 18432 266617007104
bgregg/filesys01 26112 107374156288
About the Oracle ZFS Storage Appliance 47

Table of Contents

Other manuals for Oracle ZFS Storage Appliance

Related product manuals