Mail on computer disconnectionΒΆ

Description

Send a mail when one of the computer goes offline.

Devices

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
  "currentdatetime": {
    "protocol": [ "datetime" ],
    "id": [{
      "longitude": 1.2345,
      "latitude": 12.3456
    }],
    "year": 2015,
    "month": 1,
    "day": 27,
    "hour": 14,
    "minute": 37,
    "second": 8,
    "weekday": 3,
    "dst": 1
  },
  "nasPing": {
    "protocol": [ "arping" ],
    "id": [{
      "mac": "aa:bb:cc:dd:00:11"
    }],
    "ip": "192.168.1.1",
    "state": "connected"
  }
}

Rule

1
2
3
4
5
6
{
  "nas-mail": {
    "rule": "IF nasPing.state IS disconnected THEN sendmail TO foo@bar.com SUBJECT NAS is offline since DATE_FORMAT(currentdatetime, %c) MESSAGE .",
    "active": 1
  }
}

Changed in version 8.1.0.

1
2
3
4
5
6
{
  "nas-mail": {
    "rule": "IF nasPing.state IS disconnected THEN sendmail TO foo@bar.com SUBJECT 'NAS is offline since ' .  DATE_FORMAT(currentdatetime, %c) MESSAGE ..",
    "active": 1
  }
}