VPS - check if my robot is running
VPS - check if my robot is running
17 Sep 2013, 09:11
Hi, I'm using a VPS and would like to send an e-mail with Notifications.SendEmail () every half hour to check if my robot running properly. How can I do that? Unfortunately, one cannot launch cAlgo automatically with a specific robot ...
Thanks in advance! Rainer
Replies
Cerunnos
21 Sep 2013, 11:40
Based on the article /forum/cbot-support/357#4, a simple solution that checks every hour if your robot on the VPS is running properly. Do you get no e-mail, then the robot should be stopped...
private readonly Timer _timer = new Timer();
protected override void OnStart()
{
_timer.Elapsed += OnTimedEvent;
_timer.Interval = 1 * 3600 * 1000; // Timer will tick every Interval (milliseconds) -> every hour send email
_timer.Enabled = true;
_timer.Start();
}
private void OnTimedEvent(object sender, ElapsedEventArgs e)
{
string time_ = "Timer - Robot XY is running - UTC: " + Server.Time;
Notifications.SendEmail(your_email@domain.com,"your_email@domain.com","Timer - Robot XY is running!",time_);
}
@Cerunnos
atrader
17 Sep 2013, 11:20
RE:
Cerunnos said:
use the Timer Class /forum/cbot-support/357#4
Send email: /api/internals/inotifications/sendemail-6532
start cAlgo from a robot: System.Diagnostics.Process.Start("[System.Diagnostics.Process.Start("C:\\...\\cAlgo.exe]");
/forum/suggestions/1221?page=1#6
You can just use search. most questions have been answered :)
@atrader