Parent Directory | Revision Log
ListPlugin.cpp: dont send the plugin descriptions back to user (too much text) PluginManager.cpp, HostStatusPlugin.(h|cpp), CMakeLists.txt: Add a new plugin which sends server status back to requester (data is from uptime(1) and df(1) )
1 | torben | 137 | #include "HostStatusPlugin.h" |
2 | #include "IGsmModem.h" | ||
3 | #include "Sms.h" | ||
4 | #include "util.h" | ||
5 | |||
6 | |||
7 | using namespace std; | ||
8 | |||
9 | HostStatusPlugin::HostStatusPlugin() | ||
10 | : Plugin("hoststatus", "returns an sms with host server status") | ||
11 | { | ||
12 | } | ||
13 | |||
14 | void HostStatusPlugin::Execute(IGsmModem& modem, SMS& sms) | ||
15 | { | ||
16 | string message; | ||
17 | string out; | ||
18 | |||
19 | Util::my_system("uptime", &out); | ||
20 | message += out; | ||
21 | |||
22 | Util::my_system("df -h | grep dev | awk '{ print $6 \" \" $5}'", &out); | ||
23 | message += out; | ||
24 | |||
25 | modem.SendSms(sms.sender, message, true); | ||
26 | |||
27 | } |
ViewVC Help | |
Powered by ViewVC 1.1.20 |