Zenoss zencommand
zencommand run -d device -v10
zentestcommand -d device --datasource=cpu -v10 -t10
ssh root@MachineB 'bash -s' < local_script.sh
For a script that requires sudo:
ssh root@MachineB 'echo "rootpass" | sudo -Sv && bash -s' < local_script.sh
d = find('device')
print d.id, d.title, d.manageIp
for t in d.getRRDTemplates():
for ds in t.datasources():
print ds.getCommand(d)