1 |
#include "HostStatusPlugin.h" |
#include "HostStatusPlugin.h" |
2 |
#include "IGsmModem.h" |
#include "ISmsTransceiver.h" |
3 |
#include "Sms.h" |
#include "Sms.h" |
4 |
#include "util.h" |
#include "util.h" |
5 |
|
|
11 |
{ |
{ |
12 |
} |
} |
13 |
|
|
14 |
void HostStatusPlugin::Execute(IGsmModem& modem, SMS& sms) |
void HostStatusPlugin::Execute(ISmsTransceiver& modem, SMS& sms) |
15 |
{ |
{ |
16 |
string message; |
string message; |
17 |
string out; |
string out; |
18 |
|
|
19 |
|
Util::my_system("hostname", &out); |
20 |
|
message += out; |
21 |
|
|
22 |
Util::my_system("uptime", &out); |
Util::my_system("uptime", &out); |
23 |
message += out; |
message += out; |
24 |
|
|
25 |
Util::my_system("df -h | grep dev | awk '{ print $6 \" \" $5}'", &out); |
Util::my_system("df -h | grep dev | awk '{ print $6 \" \" $5}'", &out); |
26 |
message += out; |
message += out; |
27 |
|
|
28 |
modem.SendSms(sms.sender, message, true); |
modem.SendSms(sms.GetSender(), message, true); |
29 |
|
|
30 |
} |
} |