beostat_get_disk_usage

Name

beostat_get_disk_usage -- get the disk usage on root partition of a node

Synopsis

#include <sys/beostat.h>

int beostat_get_disk_usage (int node, int *max, int *curr);

Arguments

node

The node to query

max

A pointer to an int. Upon successful completion, will contain the capacity of the root partition of the node's disk in megabytes.

curr

A pointer to an int. Upon successful completion will contain the current usage of the root partition of the node's disk in megabytes.

Description

beostat_get_disk_usage will get the current disk usage as well as the total capacity of the disk in megabytes.

Examples

 int max, curr;
 beostat_get_disk_usage (3, &max, &curr)
 printf ("CPU 0 on node 3's disk is %f percent full.\n", 
   (double) curr / (double) max );

Return Value

Returns 0 upon successful completion. If an error occurs, it will return -1.

Errors

This function relies on the Beostat subsystem, which consists of the proc filesystem on the remote node, the sendstats daemon on the remote node, the recvstats daemon on the master node, and two shared memory files in the directory /var/shm. If any part of the system breaks down, this function could fail.