DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq
sourcecode
hermesmodules
scripts
hermes-reboot-wibs.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
3
4
import
click
5
from
pexpect
import
pxssh
6
import
getpass
7
8
@click.command()
9
@click.option('-n', '--dry-run', is_flag=True)
10
@click.argument("crate", type=click.IntRange(3,5)
)
11
def
cli
(dry_run, crate):
12
""""""
13
password = getpass.getpass(
'Password: '
)
14
15
for
i
in
range(1,6):
16
hostname = f
'np04-wib-{crate}0{i}'
17
s = pxssh.pxssh()
18
s.login(hostname,
'root'
, password)
19
s.sendline(
'uptime'
)
# run a command
20
s.prompt()
# match the prompt
21
print(hostname, s.before.decode(
'utf-8'
))
# print everything before the prompt.
22
if
not
dry_run:
23
s.sendline(
'reboot'
)
# run a command
24
s.prompt()
25
print(hostname, s.before.decode(
'utf-8'
))
# print everything before the prompt.
26
s.logout()
27
28
if
__name__ ==
"__main__"
:
29
cli()
hermes-reboot-wibs.cli
cli(dry_run, crate)
Definition
hermes-reboot-wibs.py:11
Generated on Sat Jun 28 2025 for DUNE-DAQ by
1.12.0