<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Поиск закрытых алармов и причин закрытия в БД]]></title><description><![CDATA[<p dir="auto">Здравствуйте!</p>
<p dir="auto">Получить список алармов из БД (PostgreSQL) можно так:</p>
<pre><code>select
    name,
    message,
    timestamp 'epoch' + creation_time * interval '1 second' as begin,
    timestamp 'epoch' + last_change_time * interval '1 second' as last_change
from alarms inner join object_properties
    on source_object_id = object_id
order by creation_time desc
</code></pre>
<p dir="auto">Однако я не могу найти поле с отметкой о том, когда аларм был закрыт, а также кем и по какой причине.</p>
]]></description><link>https://forum.netxms.org/topic/2468/поиск-закрытых-алармов-и-причин-закрытия-в-бд</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 21:29:00 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/2468.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 Jul 2013 10:15:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Поиск закрытых алармов и причин закрытия в БД on Mon, 08 Jul 2013 12:53:25 GMT]]></title><description><![CDATA[<p dir="auto">понятно, спасибо!</p>
]]></description><link>https://forum.netxms.org/post/10720</link><guid isPermaLink="true">https://forum.netxms.org/post/10720</guid><dc:creator><![CDATA[enp]]></dc:creator><pubDate>Mon, 08 Jul 2013 12:53:25 GMT</pubDate></item><item><title><![CDATA[Reply to Поиск закрытых алармов и причин закрытия в БД on Mon, 08 Jul 2013 12:46:16 GMT]]></title><description><![CDATA[<p dir="auto">Не совсем так. Надо проверять на alarm_state = 3, term_by может быть равен 0 если аларм был закрыт пользователем admin или системой. last_change_time будет в этом случае содержать время закрытия, да.</p>
]]></description><link>https://forum.netxms.org/post/10719</link><guid isPermaLink="true">https://forum.netxms.org/post/10719</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Mon, 08 Jul 2013 12:46:16 GMT</pubDate></item><item><title><![CDATA[Reply to Поиск закрытых алармов и причин закрытия в БД on Mon, 08 Jul 2013 09:06:46 GMT]]></title><description><![CDATA[<p dir="auto">Т.е. закрытые алармы - это те, у которых term_by &lt;&gt; 0, и в этом случае дата/время закрытия - last_change_time?</p>
]]></description><link>https://forum.netxms.org/post/10714</link><guid isPermaLink="true">https://forum.netxms.org/post/10714</guid><dc:creator><![CDATA[enp]]></dc:creator><pubDate>Mon, 08 Jul 2013 09:06:46 GMT</pubDate></item><item><title><![CDATA[Reply to Поиск закрытых алармов и причин закрытия в БД on Mon, 08 Jul 2013 08:56:40 GMT]]></title><description><![CDATA[<p dir="auto">Вот такой SQL даст пользователей, которые делали acknowledge, resolve, и terminate:</p>
<pre><code>select
    op.name,
    message,
    creation_time as begin,
    last_change_time as last_change,
    u1.name as user_ack_by,
    u2.name as user_resolved_by,
    u3.name as user_term_by
from alarms
inner join object_properties op
    on source_object_id = object_id
left outer join users u1
    on u1.id=ALARMS.ack_by
left outer join users u2
    on u1.id=ALARMS.resolved_by
left outer join users u3
    on u1.id=ALARMS.term_by
order by creation_time desc
</code></pre>
<p dir="auto">Отдельных timestamp'ов на это нет, при каждом изменении обновляется last_change_time.</p>
]]></description><link>https://forum.netxms.org/post/10712</link><guid isPermaLink="true">https://forum.netxms.org/post/10712</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Mon, 08 Jul 2013 08:56:40 GMT</pubDate></item><item><title><![CDATA[Reply to Поиск закрытых алармов и причин закрытия в БД on Mon, 08 Jul 2013 04:01:13 GMT]]></title><description><![CDATA[<p dir="auto">Спасибо, я просто не увидел кнопочку "get more data" <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<p dir="auto">Однако вопрос с выборкой алармов средствами SQL по-прежнему актуален, потому что текущее представление включает слишком много колонок. Актуальность, наверное, потеряется только с решением этой проблемы -  <a href="https://www.radensolutions.com/chiliproject/issues/224" rel="nofollow ugc">https://www.radensolutions.com/chiliproject/issues/224</a></p>
]]></description><link>https://forum.netxms.org/post/10710</link><guid isPermaLink="true">https://forum.netxms.org/post/10710</guid><dc:creator><![CDATA[enp]]></dc:creator><pubDate>Mon, 08 Jul 2013 04:01:13 GMT</pubDate></item><item><title><![CDATA[Reply to Поиск закрытых алармов и причин закрытия в БД on Sat, 06 Jul 2013 19:02:29 GMT]]></title><description><![CDATA[<p dir="auto">Странно. На всякий случай - в лог выдаются первые 400 найденных записей, следующие подгружаются при нажатии "get more data" - действительно больше ничего не выдается?</p>
]]></description><link>https://forum.netxms.org/post/10705</link><guid isPermaLink="true">https://forum.netxms.org/post/10705</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Sat, 06 Jul 2013 19:02:29 GMT</pubDate></item><item><title><![CDATA[Reply to Поиск закрытых алармов и причин закрытия в БД on Fri, 05 Jul 2013 10:31:47 GMT]]></title><description><![CDATA[<p dir="auto">Да, искать по БД приходится не от хорошей жизни - в Alarm Log с фильтром по Source удается найти записи до апреля, остальных нет. Хотя в БД с тем же object_id есть записи вплоть до сегодняшнего дня. Что может так влиять на неотображение данных?</p>
]]></description><link>https://forum.netxms.org/post/10702</link><guid isPermaLink="true">https://forum.netxms.org/post/10702</guid><dc:creator><![CDATA[enp]]></dc:creator><pubDate>Fri, 05 Jul 2013 10:31:47 GMT</pubDate></item></channel></rss>