Zabbix: Получаем по известному триггеру (triggerid) номера телефонов для оповещения

Мега запрос..

SELECT
  sendto
FROM media
WHERE userid IN (SELECT
  userid
FROM (SELECT
  users_groups.userid
FROM operations
INNER JOIN opmessage_grp
  ON opmessage_grp.operationid = operations.operationid
INNER JOIN users_groups
  ON opmessage_grp.usrgrpid = users_groups.usrgrpid
WHERE operations.actionid IN (SELECT
  actionid
FROM conditions
WHERE conditiontype = 2
AND value = 15266
UNION ALL
SELECT
  actionid
FROM conditions
WHERE conditiontype = 0
AND value IN (SELECT
  groups.groupid
FROM triggers
INNER JOIN functions
  ON triggers.triggerid = functions.triggerid
INNER JOIN items
  ON items.itemid = functions.itemid
INNER JOIN hosts
  ON hosts.hostid = items.hostid
INNER JOIN hosts_groups
  ON hosts_groups.hostid = hosts.hostid
INNER JOIN groups
  ON groups.groupid = hosts_groups.groupid
WHERE triggers.triggerid = 15266)
UNION ALL
SELECT
  actionid
FROM conditions
WHERE conditiontype = 1
AND value IN (SELECT
  hosts.hostid
FROM triggers
INNER JOIN functions
  ON triggers.triggerid = functions.triggerid
INNER JOIN items
  ON items.itemid = functions.itemid
INNER JOIN hosts
  ON hosts.hostid = items.hostid
INNER JOIN hosts_groups
  ON hosts_groups.hostid = hosts.hostid
INNER JOIN groups
  ON groups.groupid = hosts_groups.groupid
WHERE triggers.triggerid = 15266))
UNION ALL
SELECT
  opmessage_usr.userid
FROM operations
INNER JOIN opmessage_usr
  ON opmessage_usr.operationid = operations.operationid
WHERE operations.actionid IN (SELECT
  actionid
FROM conditions
WHERE conditiontype = 2
AND value = 15266
UNION ALL
SELECT
  actionid
FROM conditions
WHERE conditiontype = 0
AND value IN (SELECT
  groups.groupid
FROM triggers
INNER JOIN functions
  ON triggers.triggerid = functions.triggerid
INNER JOIN items
  ON items.itemid = functions.itemid
INNER JOIN hosts
  ON hosts.hostid = items.hostid
INNER JOIN hosts_groups
  ON hosts_groups.hostid = hosts.hostid
INNER JOIN groups
  ON groups.groupid = hosts_groups.groupid
WHERE triggers.triggerid = 15266)
UNION ALL
SELECT
  actionid
FROM conditions
WHERE conditiontype = 1
AND value IN (SELECT
  hosts.hostid
FROM triggers
INNER JOIN functions
  ON triggers.triggerid = functions.triggerid
INNER JOIN items
  ON items.itemid = functions.itemid
INNER JOIN hosts
  ON hosts.hostid = items.hostid
INNER JOIN hosts_groups
  ON hosts_groups.hostid = hosts.hostid
INNER JOIN groups
  ON groups.groupid = hosts_groups.groupid
WHERE triggers.triggerid = 15266))) AS us
GROUP BY userid)
AND mediatypeid = 5;

Zabbix — MySQL запрос на выборку текущих активных алертов

SELECT groups.name,
       hosts.hostid,
       hosts.host,
       triggers.description,
       triggers.comments,
       triggers.triggerid,
       triggers.priority
FROM triggers
INNER JOIN functions ON triggers.triggerid=functions.triggerid
INNER JOIN items ON items.itemid=functions.itemid
INNER JOIN hosts ON hosts.hostid=items.hostid
INNER JOIN hosts_groups ON hosts_groups.hostid=hosts.hostid
INNER JOIN groups ON groups.groupid=hosts_groups.groupid
WHERE hosts.status = 0
  AND items.status = 0
  AND triggers.status = 0
  AND triggers.priority=3
  AND triggers.value=1;

Выбираем кто из пользователей Zabbix видит хост:

SELECT  
    usrgrp.usrgrpid ,  
    usrgrp.name  AS  user_group ,  
    groups.name  as  host_group , 
    host 
FROM  users  
    JOIN users_groups   ON  users.userid  =  users_groups.userid  
    JOIN usrgrp ON  users_groups.usrgrpid  =  usrgrp.usrgrpid  
    JOIN rights  ON  usrgrp.usrgrpid  =  rights.groupid  
    JOIN groups ON  rights.id  =  groups.groupid  
    JOIN hosts_groups  ON  groups.groupid  =  hosts_groups.groupid  
    JOIN hosts on  hosts_groups.hostid  =  hosts.hostid
    where hosts.hostid=1025;

Восстановление пароля в Remmina

  1.  Идем в папку .remmina
  2.  В файле remmina.pref ищем secret:
    cat remmina.pref | grep secret
  3. В файле *.remmina ищем password:
    cat 1451037668335.remmina | grep password
  4.  Создаем скрипт на питоне, в него подставляем secret и password:
    #!/usr/bin/python
    from Crypto.Cipher import DES3
    import base64
    secret = base64.decodestring('тут секрет')
    key = secret[:24]
    iv = secret[24:]
    EEpwd = 'тут пароль'
    DEpwd = base64.decodestring(EEpwd)
    DDpwd = DES3.new(key, DES3.MODE_CBC, iv).decrypt(DEpwd)
    print "Decoded (Decrypted ( PWD ) ) : ",DDpwd