- 论坛徽章:
- 0
|
请教
1, ok, get local machine load averager , below suppose you are in linux machine
$ uptime
9:37am up 700 days, 21:58, 33 users, load average: 0.18, 0.08, 0.02
$uptime |cut -dg -f2 |cut -d: -f2
0.18, 0.08, 0.02
that is the info you need in each compute node
so the script file like :
#!/bin/sh
uptime |cut -dg -f2 |cut -d: -f2
2, how to get other nodes same info to "server"
sample in one node
edit /etc/service add following
latenet 4777 tcp
then in your /etc/xinet.d add
service latelnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /path_to_your_script
log_on_failure += USERID
disable = no
}
restar your xinetd service
try to telnet your_node_ip 4777
you will get the infor you need |
|