-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathotrs-exporter.sopm
181 lines (175 loc) · 11.7 KB
/
otrs-exporter.sopm
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?xml version="1.0" encoding="utf-8" ?>
<otrs_package version="1.0">
<Name>OTRS-Exporter</Name>
<Version>0.0.4</Version>
<Framework>6.x.x</Framework>
<Vendor>Rydlab</Vendor>
<URL>https://rydlab.ru/</URL>
<License>GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007</License>
<Description Lang="en">A prometheus module for OTRS</Description>
<Description Lang="ru">Модуль для системы сбора метрик 'Prometheus'</Description>
<IntroInstall Type="pre" Lang="en" Title="Needed packages">
To use OTRS exporter you will need a few packages:
Net::Prometheus Time::HiRes List::Util Scalar::Util Proc::ProcessTable Proc::Exists IPC::ShareLite Sereal
You can install them using cpanminus
</IntroInstall>
<IntroInstall Type="pre" Lang="ru" Title="Зависимости">
Перед установкой пакета, вам необходимо загрузить или обновить следующие пакеты:
Net::Prometheus Time::HiRes List::Util Scalar::Util Proc::ProcessTable Proc::Exists IPC::ShareLite Sereal
Вы можете установить их используя cpanminus
</IntroInstall>
<IntroInstall Type="post" Lang="en" Title="Thank you for installing OTRS exporter!">
Thank you for installing OTRS exporter! Now you can create a new web-service using HTTP::Sendtext transport module and Prometheus::MetricGet operation!
Then you can configurate your Prometheus and Grafana servers using our example dashboards at $OTRS_HOME/doc/GrafanaExamples/
</IntroInstall>
<IntroInstall Type="post" Lang="ru" Title="Спасибо за установку OTRS exporter!">
Спасибо за установку OTRS exporter! Теперь вы можете создать новый веб-сервис, используя транспортный модуль HTTP::Sendtext и Prometheus::MetricGet операцию!
Затем вы можете настроить ваши Prometheus и Grafana сервера, используя образцы дашбоардов в $OTRS_HOME/doc/GrafanaExamples/.
</IntroInstall>
<ChangeLog Version="0.0.1" Date="2020-02-16 17:00:00">First release</ChangeLog>
<ChangeLog Version="0.0.2" Date="2020-02-20 12:00:00">Modified Net::Prometheus::ProcessCollector::linux to resolve problem with BOOTTIME</ChangeLog>
<ChangeLog Version="0.0.3" Date="2020-02-25 16:20:00">
Added option for guard backends. Added cache-backend for guard. Improved process collecting. Russian language support added
</ChangeLog>
<ChangeLog Version="0.0.4" Date="2020-04-10 18:00:00">
Policy for saving metrics changed.
</ChangeLog>
<PackageIsVisible>1</PackageIsVisible>
<PackageIsDownloadable>1</PackageIsDownloadable>
<PackageIsRemovable>1</PackageIsRemovable>
<BuildDate>?</BuildDate>
<BuildHost>?</BuildHost>
<ModuleRequired Version="0.07">Net::Prometheus</ModuleRequired>
<ModuleRequired Version="1">Time::HiRes</ModuleRequired>
<ModuleRequired Version="1">List::Util</ModuleRequired>
<ModuleRequired Version="1">Scalar::Util</ModuleRequired>
<ModuleRequired Version="0.5">Proc::ProcessTable</ModuleRequired>
<ModuleRequired Version="1">Proc::Exists</ModuleRequired>
<ModuleRequired Version="0.1">IPC::ShareLite</ModuleRequired>
<ModuleRequired Version="4">Sereal</ModuleRequired>
<OS>linux</OS>
<Filelist>
<File Permission="644" Location="Kernel/Language/ru_AdminPrometheus.pm"></File>
<File Permission="644" Location="Kernel/Modules/AdminPrometheus.pm"></File>
<File Permission="644" Location="Kernel/Modules/AdminGenericInterfaceTransportHTTPSendText.pm"></File>
<File Permission="644" Location="Kernel/Output/HTML/Templates/Standard/MetricForm.tt"></File>
<File Permission="644" Location="Kernel/Output/HTML/Templates/Standard/AdminPrometheus.tt"></File>
<File Permission="644" Location="Kernel/Output/HTML/Templates/Standard/AdminPrometheusChangeMetric.tt"></File>
<File Permission="644" Location="Kernel/Output/HTML/Templates/Standard/AdminPrometheusCreateMetric.tt"></File>
<File Permission="644" Location="Kernel/Output/HTML/Templates/Standard/AdminGenericInterfaceTransportHTTPSendText.tt"></File>
<File Permission="644" Location="Kernel/GenericInterface/Operation/Prometheus/MetricGet.pm"></File>
<File Permission="644" Location="Kernel/GenericInterface/Transport/HTTP/SendText.pm"></File>
<File Permission="644" Location="Kernel/Config/Files/XML/SendTextGenericInterface.xml"></File>
<File Permission="644" Location="Kernel/Config/Files/XML/Prometheus.xml"></File>
<File Permission="644" Location="Kernel/System/Prometheus/Guard.pm"></File>
<File Permission="644" Location="Kernel/System/Prometheus/Guard/SHM.pm"></File>
<File Permission="644" Location="Kernel/System/Prometheus/Guard/Cache.pm"></File>
<File Permission="644" Location="Kernel/System/Prometheus/Helper.pm"></File>
<File Permission="644" Location="Kernel/System/Prometheus/MetricManager.pm"></File>
<File Permission="644" Location="Kernel/System/Console/Command/Maint/Prometheus/ClearMemory.pm"></File>
<File Permission="644" Location="Kernel/System/Console/Command/Maint/Prometheus/DeleteDiedPIDs.pm"></File>
<File Permission="644" Location="Kernel/System/Prometheus.pm"></File>
<File Permission="644" Location="Custom/Kernel/GenericInterface/Provider.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/Cache.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/MailAccount/IMAP.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/MailAccount/IMAPTLS.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/MailAccount/POP3.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/Email.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/Log.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/Web/InterfaceAgent.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/Web/InterfaceCustomer.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/Web/InterfacePublic.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/Web/Request.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/Daemon/DaemonModules/SchedulerTaskWorker.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/Daemon/DaemonModules/SchedulerGenericAgentTaskManager.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/Daemon/DaemonModules/SchedulerCronTaskManager.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/Daemon/DaemonModules/SystemConfigurationSyncManager.pm"></File>
<File Permission="644" Location="Custom/Kernel/System/Daemon/DaemonModules/SchedulerFutureTaskManager.pm"></File>
<File Permission="644" Location="var/httpd/htdocs/js/Core.Agent.Admin.Prometheus.js"></File>
<File Permission="644" Location="var/httpd/htdocs/js/Core.Agent.Admin.GenericInterfaceTransportHTTPSendText.js"></File>
<File Permission="644" Location="doc/GrafanaExamples/dashboard-otrs.json"></File>
<File Permission="644" Location="doc/GrafanaExamples/dashboard-web.json"></File>
<File Permission="644" Location="doc/GrafanaExamples/dashboard-http-server.json"></File>
<File Permission="644" Location="doc/GrafanaExamples/dashboard-daemon.json"></File>
</Filelist>
<DatabaseInstall>
<TableCreate Name="metric_types">
<Column Name="id" Required="true" PrimaryKey="true" AutoIncrement="true" Type="SMALLINT"/>
<Column Name="type_name" Required="true" Size="256" Type="VARCHAR"/>
<Unique Name="metric_type_name">
<UniqueColumn Name="type_name"/>
</Unique>
</TableCreate>
<TableCreate Name="metric_update_methods">
<Column Name="id" Required="true" PrimaryKey="true" AutoIncrement="true" Type="SMALLINT"/>
<Column Name="metric_type_id" Required="true" Type="SMALLINT"/>
<Column Name="name" Required="true" Size="256" Type="VARCHAR"/>
<ForeignKey ForeignTable="metric_types">
<Reference Local="metric_type_id" Foreign="id"/>
</ForeignKey>
</TableCreate>
<TableCreate Name="custom_metrics">
<Column Name="id" Required="true" PrimaryKey="true" AutoIncrement="true" Type="BIGINT"/>
<Column Name="namespace" Required="false" Size="256" Type="VARCHAR"/>
<Column Name="name" Required="true" Size="256" Type="VARCHAR"/>
<Column Name="help" Required="true" Size="1000" Type="VARCHAR"/>
<Column Name="metric_type_id" Required="true" Type="SMALLINT"/>
<Unique Name="custom_metric_name">
<UniqueColumn Name="name"/>
</Unique>
<ForeignKey ForeignTable="metric_types">
<Reference Local="metric_type_id" Foreign="id"/>
</ForeignKey>
</TableCreate>
<TableCreate Name="custom_metric_labels">
<Column Name="id" Required="true" PrimaryKey="true" AutoIncrement="true" Type="BIGINT"/>
<Column Name="name" Required="true" Size="256" Type="VARCHAR"/>
<Column Name="custom_metric_id" Required="true" Type="BIGINT"/>
<Column Name="queue_num" Required="true" Type="INTEGER"/>
<ForeignKey ForeignTable="custom_metrics">
<Reference Local="custom_metric_id" Foreign="id"/>
</ForeignKey>
</TableCreate>
<TableCreate Name="custom_metric_buckets">
<Column Name="id" Required="true" PrimaryKey="true" AutoIncrement="true" Type="BIGINT"/>
<Column Name="custom_metric_id" Required="true" Type="BIGINT"/>
<Column Name="value" Required="true" Type="BIGINT"/>
<ForeignKey ForeignTable="custom_metrics">
<Reference Local="custom_metric_id" Foreign="id"/>
</ForeignKey>
</TableCreate>
<TableCreate Name="custom_metric_sql">
<Column Name="id" Required="true" PrimaryKey="true" AutoIncrement="true" Type="BIGINT"/>
<Column Name="query_text" Required="true" Size="2000" Type="VARCHAR"/>
<Column Name="custom_metric_id" Required="true" Type="BIGINT"/>
<Column Name="update_method_id" Required="true" Type="SMALLINT"/>
<ForeignKey ForeignTable="custom_metrics">
<Reference Local="custom_metric_id" Foreign="id"/>
</ForeignKey>
<ForeignKey ForeignTable="metric_update_methods">
<Reference Local="update_method_id" Foreign="id"/>
</ForeignKey>
</TableCreate>
</DatabaseInstall>
<DatabaseUninstall>
<TableDrop Name="custom_metric_sql"/>
<TableDrop Name="custom_metric_buckets"/>
<TableDrop Name="custom_metric_labels"/>
<TableDrop Name="custom_metrics"/>
<TableDrop Name="metric_update_methods"/>
<TableDrop Name="metric_types"/>
</DatabaseUninstall>
<CodeInstall><![CDATA[
$Kernel::OM->Get('Kernel::System::DB')->Do(
SQL => "INSERT INTO metric_types(id, type_name) VALUES
(1, 'counter'), (2, 'gauge'),(3, 'histogram'),(4, 'summary')",
);
$Kernel::OM->Get('Kernel::System::DB')->Do(
SQL => "INSERT INTO metric_update_methods(metric_type_id, name) VALUES
(1, 'inc'),
(2, 'inc'), (2, 'set'), (2, 'dec'),
(3, 'observe'),
(4, 'observe')",
);
]]></CodeInstall>
</otrs_package>