Hello,
Is there a way to send a shutdown command to ALL computers in the OPSI database from the servers command line ? and also the same for wakeup ?
Mass shutdown / wakeup
Re: Mass shutdown / wakeup
# opsi-admin -d method hostControl_shutdown '*'
# opsi-admin -d method hostControl_start '*'
?
# opsi-admin -d method hostControl_start '*'
?
Re: Mass shutdown / wakeup
Shutdown works fine, but startup does not happen (because of broadcast domains, vlans and so on).
Is it possible to dump the mac-address result from:
# opsi-admin -d method hostControl_start '*'
To run on other machine with access to the vlans, or can parts of OPSI be installed on does machines so that command can be run there ?
Is it possible to dump the mac-address result from:
# opsi-admin -d method hostControl_start '*'
To run on other machine with access to the vlans, or can parts of OPSI be installed on does machines so that command can be run there ?
Re: Mass shutdown / wakeup
You could loop:
# opsi-admin -d method getMacAddress CLIENT_ID
for each client..
also there is method: host_getObjects('*attributes', '**filter')..
I guess it should return only certain attributes of hosts matched by filter, but I am not sure how to pass arguments in order to get "hardwareAddress" (and maybe "ipAddress") of hosts with "type" : "OpsiClient"..
so you can simply run:
# opsi-admin -d method host_getObjects
and grep only what is needed..
# opsi-admin -d method getMacAddress CLIENT_ID
for each client..
also there is method: host_getObjects('*attributes', '**filter')..
I guess it should return only certain attributes of hosts matched by filter, but I am not sure how to pass arguments in order to get "hardwareAddress" (and maybe "ipAddress") of hosts with "type" : "OpsiClient"..
so you can simply run:
# opsi-admin -d method host_getObjects
and grep only what is needed..
Re: Mass shutdown / wakeup
Thanks for input.
grep seems the fastest way, so ended up with:
opsi-admin -d method host_getObjects | grep "hardwareAddress" | cut -c 32-48
grep seems the fastest way, so ended up with:
opsi-admin -d method host_getObjects | grep "hardwareAddress" | cut -c 32-48