|
|
@ -104,6 +104,23 @@ def process_command_check(message, command, adm)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def process_command_report(message, command, adm)
|
|
|
|
|
|
|
|
if is_chat_authorized?(message, @auth_chat) || message_from_admin?(message, adm)
|
|
|
|
|
|
|
|
report = "Full Report:\n\n"
|
|
|
|
|
|
|
|
@probes.each do |k,v|
|
|
|
|
|
|
|
|
zone = v["loc"].to_s
|
|
|
|
|
|
|
|
host = k
|
|
|
|
|
|
|
|
print "#{host}: #{zone} "
|
|
|
|
|
|
|
|
tdata = `ssh #{host} heatbot_gettemp`
|
|
|
|
|
|
|
|
print "[#{tdata}°#{@tunit}]\n"
|
|
|
|
|
|
|
|
report = report + "#{zone}: #{tdata}°#{@tunit}\n"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
send_message(message.chat.id,report)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
send_message(message.chat.id,"I am not authorized to provide this information here.")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def process_command_test(message, command, adm)
|
|
|
|
def process_command_test(message, command, adm)
|
|
|
|
if is_chat_authorized?(message, @auth_chat) || message_from_admin?(message, adm)
|
|
|
|
if is_chat_authorized?(message, @auth_chat) || message_from_admin?(message, adm)
|
|
|
|
#reply = `scripts/tempf.py`
|
|
|
|
#reply = `scripts/tempf.py`
|
|
|
|