button={ label=QUIT action=QUIT }


startup={ action="PRINT Run this example from the command line 
with -var hostlist to monitor additional hosts.\n " }

!add hosts here or use -var hostlist on the command line
var={ name=hostlist value=" `hostname` " }

var={ name=num value=`echo $hostlist | wc -w` }

var={ name=loadfunc value=0
      action="ASSIGN graph $val"  
      action="SET loadlist list $val"	
}

hbox={ name=noborder

  list={ name=host label=hostname itemlist={ list=$hostlist }  
	font=fixed columns=1 }

  vbox={ 
     message={ value=load font=fixed }
     graph={ name=graph height=15 width=100 foreground=red
	nsamp=$num orientation=horizontal min=0 max=10 value=0 }
  }

  list={ name=loadlist label=load itemlist={ list=$hostlist }  
	font=fixed columns=1 }
}

! this tries to test if you have rup on your machine
! if you don't it will quit
startup={ 
    test={ 
    condition=" test ``which rup 2>/dev/null | awk '{print $$1}'`` != no "
    true={ action="ASSIGN loadfunc `rup $hostlist | sed -e 's/^.*average://' | awk '{print $$1}' | tr -d '\054' `"
    }
    false={ action="PRINT \n you don't appear to have rup on this machine so this example won't work\n" action=QUIT }
    }
}

timer={ interval=5 
action="ASSIGN loadfunc `rup $hostlist | sed -e 's/^.*average://' | awk '{print$$1}' | tr -d '\054' `"
}
