Merge branch 'v1' of https://www.cainet.info/git/cai/CAI-Watchdog into v1
This commit is contained in:
commit
fa0ec74b35
20
README.md
20
README.md
@ -113,15 +113,19 @@ If you want to get messages when watchdog service is stopped, uncomment followin
|
|||||||
Watchdog can send notifications on user login. Just add to ```/etc/profile.d/sshinfo.sh``` next lines:
|
Watchdog can send notifications on user login. Just add to ```/etc/profile.d/sshinfo.sh``` next lines:
|
||||||
|
|
||||||
- For Telegram:
|
- For Telegram:
|
||||||
1. ```User=$(whoami)```
|
```
|
||||||
1. ```IP=$(echo $SSH_CONNECTION | awk '{ print $1 == "" ? "127.0.0.1" : $1 }')```
|
User=$(whoami)
|
||||||
1. ```ICON_INFO=$(echo -e "\U2139")```
|
IP=$(echo $SSH_CONNECTION | awk '{ print $1 == "" ? "127.0.0.1" : $1 }')
|
||||||
1. ```send-telegram "${ICON_INFO} SSH: User ${Users} is logged in from ${IP}"```
|
ICON_INFO=$(echo -e "\U2139")
|
||||||
|
send-telegram "${ICON_INFO} SSH: User ${User} is logged in from ${IP}"
|
||||||
|
```
|
||||||
- For e-mail:
|
- For e-mail:
|
||||||
1. ```User=$(whoami)```
|
```
|
||||||
1. ```IP=$(echo $SSH_CONNECTION | awk '{ print $1 == "" ? "127.0.0.1" : $1 }')```
|
User=$(whoami)
|
||||||
1. ```ICON_INFO=$(echo -e "\U2139")```
|
IP=$(echo $SSH_CONNECTION | awk '{ print $1 == "" ? "127.0.0.1" : $1 }')
|
||||||
1. ```send-mail your@mail.addr '${ICON_INFO} SSH: User ${Users} is logged in' '${ICON_INFO} SSH: User ${Users} is logged in from ${IP}'```
|
ICON_INFO=$(echo -e "\U2139")
|
||||||
|
send-mail your@mail.addr '${ICON_INFO} SSH: User ${User} is logged in' '${ICON_INFO} SSH: User ${User} is logged in from ${IP}'
|
||||||
|
```
|
||||||
|
|
||||||
## User logouts monitoring (*nix)
|
## User logouts monitoring (*nix)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user