Template_Yunohost.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <zabbix_export>
  3. <version>5.0</version>
  4. <date>2020-11-26T12:48:35Z</date>
  5. <groups>
  6. <group>
  7. <name>Templates/Applications</name>
  8. </group>
  9. </groups>
  10. <templates>
  11. <template>
  12. <template>Template Yunohost</template>
  13. <name>Template Yunohost</name>
  14. <description>Please check default value template macro.&#13;
  15. &#13;
  16. cat /etc/sudoers.d/zabbix &#13;
  17. zabbix ALL=(ALL) NOPASSWD: /etc/zabbix/zabbix_agentd.d/yunohost.sh&#13;
  18. &#13;
  19. cat /etc/zabbix/zabbix_agentd.d/userP_yunohost.conf &#13;
  20. UserParameter=yunohost.users.discover,sudo /etc/zabbix/zabbix_agentd.d/yunohost.sh yunohost.users.discover&#13;
  21. UserParameter=yunohost.user.quota[*],sudo /etc/zabbix/zabbix_agentd.d/yunohost.sh yunohost.user.quota &quot;$1&quot;&#13;
  22. UserParameter=yunohost.domains.discover,sudo /etc/zabbix/zabbix_agentd.d/yunohost.sh yunohost.domains.discover&#13;
  23. UserParameter=yunohost.domain.cert[*],sudo /etc/zabbix/zabbix_agentd.d/yunohost.sh yunohost.domain.cert &quot;$1&quot;&#13;
  24. UserParameter=yunohost.services.discover,sudo /etc/zabbix/zabbix_agentd.d/yunohost.sh yunohost.services.discover&#13;
  25. UserParameter=yunohost.service.status[*],sudo /etc/zabbix/zabbix_agentd.d/yunohost.sh yunohost.service.status &quot;$1&quot;&#13;
  26. UserParameter=yunohost.backups.number,sudo /etc/zabbix/zabbix_agentd.d/yunohost.sh yunohost.backups.number&#13;
  27. UserParameter=yunohost.backups.ageoflastbackup,sudo /etc/zabbix/zabbix_agentd.d/yunohost.sh yunohost.backups.ageoflastbackup&#13;
  28. UserParameter=yunohost.ports.tcp.discover,sudo /etc/zabbix/zabbix_agentd.d/yunohost.sh yunohost.ports.tcp.discovery&#13;
  29. UserParameter=yunohost.ports.udp.discover,sudo /etc/zabbix/zabbix_agentd.d/yunohost.sh yunohost.ports.udp.discovery&#13;
  30. UserParameter=yunohost.migrations.lastinstalled,sudo /etc/zabbix/zabbix_agentd.d/yunohost.sh yunohost.migrations.lastinstalled&#13;
  31. UserParameter=yunohost.migrations.lastavailable,sudo /etc/zabbix/zabbix_agentd.d/yunohost.sh yunohost.migrations.lastavailable&#13;
  32. &#13;
  33. cat /etc/zabbix/zabbix_agentd.d/yunohost.sh &#13;
  34. #!/bin/bash&#13;
  35. yunobin=$(which yunohost)&#13;
  36. &#13;
  37. if [ &quot;$1&quot; == &quot;yunohost.users.discover&quot; ];then&#13;
  38. users=$($yunobin user list --fields 'uid' | awk -F ': ' '/username: / {print $2}');echo -n &quot;{\&quot;data\&quot;:[&quot;;for user in $users;do echo -n &quot;{\&quot;{#USERNAME}\&quot;:\&quot;$user\&quot;},&quot;;done | sed 's/,$//' ;echo &quot;]}&quot;&#13;
  39. fi&#13;
  40. &#13;
  41. if [ &quot;$1&quot; == &quot;yunohost.user.quota&quot; ] ;then&#13;
  42. quota=$($yunobin user info &quot;$2&quot; | grep -Po &quot;use:.*\(\K([0-9]{1,3})&quot;);if [ -z &quot;$quota&quot; ];then echo 0 ; else echo &quot;$quota&quot; ;fi&#13;
  43. fi&#13;
  44. &#13;
  45. if [ &quot;$1&quot; == &quot;yunohost.domains.discover&quot; ] ;then&#13;
  46. domains=$($yunobin domain list --output-as plain);echo -n &quot;{\&quot;data\&quot;:[&quot;;for domain in $domains;do echo -n &quot;{\&quot;{#DOMAIN}\&quot;:\&quot;$domain\&quot;},&quot;;done | sed 's/,$//' ;echo &quot;]}&quot;&#13;
  47. fi&#13;
  48. &#13;
  49. if [ &quot;$1&quot; == &quot;yunohost.domain.cert&quot; ] ;then&#13;
  50. $yunobin domain cert-status &quot;$2&quot; --output-as plain --full| awk '/#/{ next;} {printf &quot;%s;&quot;,$0} END {print &quot;&quot;}'&#13;
  51. fi&#13;
  52. &#13;
  53. if [ &quot;$1&quot; == &quot;yunohost.services.discover&quot; ] ;then&#13;
  54. services=$($yunobin service status 2&gt;/dev/null| grep -Po '^([A-Za-z]+)(?=(:))');echo -n &quot;{\&quot;data\&quot;:[&quot;;for service in $services;do echo -n &quot;{\&quot;{#SERVICE}\&quot;:\&quot;$service\&quot;},&quot;;done | sed 's/,$//' ;echo &quot;]}&quot;&#13;
  55. fi&#13;
  56. &#13;
  57. if [ &quot;$1&quot; == &quot;yunohost.service.status&quot; ] ;then&#13;
  58. service=$($yunobin service status &quot;$2&quot; --output-as json 2&gt;/dev/null)&#13;
  59. if [[ &quot;$(echo $service | jq -r '.description')&quot; == *&quot;doesn't exists for systemd&quot;* ]] ;then&#13;
  60. echo &quot;$service&quot; | jq -c '.active = &quot;disabled&quot;' &#13;
  61. else&#13;
  62. echo &quot;$service&quot;&#13;
  63. fi&#13;
  64. fi&#13;
  65. &#13;
  66. if [ &quot;$1&quot; == &quot;yunohost.backups.number&quot; ] ;then&#13;
  67. $yunobin backup list --output-as plain | wc -l&#13;
  68. fi&#13;
  69. &#13;
  70. if [ &quot;$1&quot; == &quot;yunohost.backups.ageoflastbackup&quot; ] ;then&#13;
  71. if [ $($yunobin backup list --output-as plain | wc -l) -ne 0 ] ;then&#13;
  72. timestamp=$(date +&quot;%d/%m/%Y %H:%M&quot; -d&quot;$($yunobin backup list -i | tail -n 4 | head -n 1 | grep -Po 'created_at: \K(.*)')&quot;)&#13;
  73. echo $(( ($(date +%s) - $(date -d&quot;$timestamp&quot; +%s))/(60*60*24) ))&#13;
  74. else&#13;
  75. echo &quot;No backup detected&quot;&#13;
  76. fi&#13;
  77. fi&#13;
  78. &#13;
  79. if [ &quot;$1&quot; == &quot;yunohost.ports.tcp.discovery&quot; ] ;then&#13;
  80. ports=$($yunobin firewall list -r --output-as plain | awk '/#ipv4/{flag=1;next}/#uPnP/{flag=0}flag' | awk '/##TCP/{flag=1;next}/##TCP/{flag=0}flag');echo -n &quot;{\&quot;data\&quot;:[&quot;;for port in $ports;do echo -n &quot;{\&quot;{#PORT}\&quot;:\&quot;$port\&quot;},&quot;;done | sed 's/,$//' ;echo &quot;]}&quot;&#13;
  81. fi&#13;
  82. &#13;
  83. if [ &quot;$1&quot; == &quot;yunohost.ports.udp.discovery&quot; ] ;then&#13;
  84. ports=$($yunobin firewall list -r --output-as plain | awk '/#ipv4/{flag=1;next}/#uPnP/{flag=0}flag' | awk '/##UDP/{flag=1;next}/##TCP/{flag=0}flag');echo -n &quot;{\&quot;data\&quot;:[&quot;;for port in $ports;do echo -n &quot;{\&quot;{#PORT}\&quot;:\&quot;$port\&quot;},&quot;;done | sed 's/,$//' ;echo &quot;]}&quot;&#13;
  85. fi&#13;
  86. &#13;
  87. if [ &quot;$1&quot; == &quot;yunohost.migrations.lastinstalled&quot; ] ;then&#13;
  88. $yunobin tools migrations state | grep -Po &quot; number: \K(.*)&quot;&#13;
  89. fi&#13;
  90. &#13;
  91. if [ &quot;$1&quot; == &quot;yunohost.migrations.lastavailable&quot; ] ;then&#13;
  92. $yunobin tools migrations list | tail -n 1 | grep -Po &quot; number: \K(.*)&quot;&#13;
  93. fi</description>
  94. <groups>
  95. <group>
  96. <name>Templates/Applications</name>
  97. </group>
  98. </groups>
  99. <applications>
  100. <application>
  101. <name>Yunohost : Backups</name>
  102. </application>
  103. <application>
  104. <name>Yunohost : Certificates</name>
  105. </application>
  106. <application>
  107. <name>Yunohost : Certificates : Expiration</name>
  108. </application>
  109. <application>
  110. <name>Yunohost : Certificates : State</name>
  111. </application>
  112. <application>
  113. <name>Yunohost : Migrations</name>
  114. </application>
  115. <application>
  116. <name>Yunohost : Ports</name>
  117. </application>
  118. <application>
  119. <name>Yunohost : Services</name>
  120. </application>
  121. <application>
  122. <name>Yunohost : Services : Status</name>
  123. </application>
  124. <application>
  125. <name>Yunohost : Users</name>
  126. </application>
  127. </applications>
  128. <items>
  129. <item>
  130. <name>Age of the last backup</name>
  131. <key>yunohost.backups.ageoflastbackup</key>
  132. <delay>1d;h10m45</delay>
  133. <units>days</units>
  134. <applications>
  135. <application>
  136. <name>Yunohost : Backups</name>
  137. </application>
  138. </applications>
  139. <triggers>
  140. <trigger>
  141. <expression>{last()}&gt;={$YUNOHOST.BACKUP.MAXDAYS}</expression>
  142. <name>YunoHost hasn't backup since more than {$YUNOHOST.BACKUP.MAXDAYS} days</name>
  143. <opdata>{ITEM.LASTVALUE}</opdata>
  144. <priority>HIGH</priority>
  145. <description>Please check https://yunohost.org/en/backup</description>
  146. <manual_close>YES</manual_close>
  147. </trigger>
  148. </triggers>
  149. </item>
  150. <item>
  151. <name>Number of Yunohost backups</name>
  152. <key>yunohost.backups.number</key>
  153. <delay>1d;h11</delay>
  154. <applications>
  155. <application>
  156. <name>Yunohost : Backups</name>
  157. </application>
  158. </applications>
  159. <triggers>
  160. <trigger>
  161. <expression>{last()}=0</expression>
  162. <name>YunoHost hasn't backup yet</name>
  163. <priority>HIGH</priority>
  164. <description>Please check https://yunohost.org/en/backup</description>
  165. <manual_close>YES</manual_close>
  166. </trigger>
  167. </triggers>
  168. </item>
  169. <item>
  170. <name>Id of the last migration available</name>
  171. <key>yunohost.migrations.lastavailable</key>
  172. <delay>1d;h10m50</delay>
  173. <applications>
  174. <application>
  175. <name>Yunohost : Migrations</name>
  176. </application>
  177. </applications>
  178. </item>
  179. <item>
  180. <name>Id of the last migration installed</name>
  181. <key>yunohost.migrations.lastinstalled</key>
  182. <delay>1d;h10m55</delay>
  183. <applications>
  184. <application>
  185. <name>Yunohost : Migrations</name>
  186. </application>
  187. </applications>
  188. </item>
  189. </items>
  190. <discovery_rules>
  191. <discovery_rule>
  192. <name>Yunohost domains</name>
  193. <key>yunohost.domains.discover</key>
  194. <delay>1d;h10</delay>
  195. <item_prototypes>
  196. <item_prototype>
  197. <name>Certificate {#DOMAIN} expiration</name>
  198. <type>DEPENDENT</type>
  199. <key>yunohost.domain.cert.expiration[{#DOMAIN}]</key>
  200. <delay>0</delay>
  201. <history>180d</history>
  202. <units>d</units>
  203. <applications>
  204. <application>
  205. <name>Yunohost : Certificates</name>
  206. </application>
  207. <application>
  208. <name>Yunohost : Certificates : Expiration</name>
  209. </application>
  210. </applications>
  211. <preprocessing>
  212. <step>
  213. <type>REGEX</type>
  214. <params>(.*);(.*);(.*);(.*);(.*);(.*);(.*);(.*);
  215. \2</params>
  216. </step>
  217. </preprocessing>
  218. <master_item>
  219. <key>yunohost.domain.cert[{#DOMAIN}]</key>
  220. </master_item>
  221. <trigger_prototypes>
  222. <trigger_prototype>
  223. <expression>{last()}&lt;{$YUNOHOST.CERTIFICATE.REMAININGDAYS_AVG}</expression>
  224. <name>Remaining days for certificate {#DOMAIN} &lt; {$YUNOHOST.CERTIFICATE.REMAININGDAYS_AVG}</name>
  225. <opdata>{ITEM.LASTVALUE}</opdata>
  226. <priority>AVERAGE</priority>
  227. <dependencies>
  228. <dependency>
  229. <name>Remaining days for certificate {#DOMAIN} &lt; {$YUNOHOST.CERTIFICATE.REMAININGDAYS_DISASTER}</name>
  230. <expression>{Template Yunohost:yunohost.domain.cert.expiration[{#DOMAIN}].last()}&lt; {$YUNOHOST.CERTIFICATE.REMAININGDAYS_DISASTER}</expression>
  231. </dependency>
  232. <dependency>
  233. <name>Remaining days for certificate {#DOMAIN} &lt; {$YUNOHOST.CERTIFICATE.REMAININGDAYS_HIGH}</name>
  234. <expression>{Template Yunohost:yunohost.domain.cert.expiration[{#DOMAIN}].last()}&lt;{$YUNOHOST.CERTIFICATE.REMAININGDAYS_HIGH}</expression>
  235. </dependency>
  236. </dependencies>
  237. </trigger_prototype>
  238. <trigger_prototype>
  239. <expression>{last()}&lt; {$YUNOHOST.CERTIFICATE.REMAININGDAYS_DISASTER}</expression>
  240. <name>Remaining days for certificate {#DOMAIN} &lt; {$YUNOHOST.CERTIFICATE.REMAININGDAYS_DISASTER}</name>
  241. <opdata>{ITEM.LASTVALUE}</opdata>
  242. <priority>DISASTER</priority>
  243. </trigger_prototype>
  244. <trigger_prototype>
  245. <expression>{last()}&lt;{$YUNOHOST.CERTIFICATE.REMAININGDAYS_HIGH}</expression>
  246. <name>Remaining days for certificate {#DOMAIN} &lt; {$YUNOHOST.CERTIFICATE.REMAININGDAYS_HIGH}</name>
  247. <opdata>{ITEM.LASTVALUE}</opdata>
  248. <priority>HIGH</priority>
  249. <dependencies>
  250. <dependency>
  251. <name>Remaining days for certificate {#DOMAIN} &lt; {$YUNOHOST.CERTIFICATE.REMAININGDAYS_DISASTER}</name>
  252. <expression>{Template Yunohost:yunohost.domain.cert.expiration[{#DOMAIN}].last()}&lt; {$YUNOHOST.CERTIFICATE.REMAININGDAYS_DISASTER}</expression>
  253. </dependency>
  254. </dependencies>
  255. </trigger_prototype>
  256. </trigger_prototypes>
  257. </item_prototype>
  258. <item_prototype>
  259. <name>Certificate {#DOMAIN} state</name>
  260. <type>DEPENDENT</type>
  261. <key>yunohost.domain.cert.state[{#DOMAIN}]</key>
  262. <delay>0</delay>
  263. <history>180d</history>
  264. <trends>0</trends>
  265. <value_type>CHAR</value_type>
  266. <applications>
  267. <application>
  268. <name>Yunohost : Certificates</name>
  269. </application>
  270. <application>
  271. <name>Yunohost : Certificates : State</name>
  272. </application>
  273. </applications>
  274. <valuemap>
  275. <name>Yunohost : certificates</name>
  276. </valuemap>
  277. <preprocessing>
  278. <step>
  279. <type>REGEX</type>
  280. <params>(.*);(.*);(.*);(.*);(.*);(.*);(.*);(.*);
  281. \3:unknown=0:critical=1:warning=2:attention=3:good=4;great=5</params>
  282. </step>
  283. <step>
  284. <type>REGEX</type>
  285. <params>^(unknown|critical|warning|attention|good|great):(?=.*\1=(\d))
  286. \2</params>
  287. </step>
  288. </preprocessing>
  289. <master_item>
  290. <key>yunohost.domain.cert[{#DOMAIN}]</key>
  291. </master_item>
  292. </item_prototype>
  293. <item_prototype>
  294. <name>Informations {#DOMAIN} full</name>
  295. <key>yunohost.domain.cert[{#DOMAIN}]</key>
  296. <delay>1d</delay>
  297. <history>180d</history>
  298. <trends>0</trends>
  299. <value_type>CHAR</value_type>
  300. <applications>
  301. <application>
  302. <name>Yunohost : Certificates</name>
  303. </application>
  304. </applications>
  305. </item_prototype>
  306. </item_prototypes>
  307. </discovery_rule>
  308. <discovery_rule>
  309. <name>TCP Ports opened</name>
  310. <key>yunohost.ports.tcp.discover</key>
  311. <delay>1d;h9m30</delay>
  312. <lifetime>7d</lifetime>
  313. <item_prototypes>
  314. <item_prototype>
  315. <name>Check TCP port {#PORT} responding</name>
  316. <key>net.tcp.service[tcp,127.0.0.1,{#PORT}]</key>
  317. <delay>900s</delay>
  318. <applications>
  319. <application>
  320. <name>Yunohost : Ports</name>
  321. </application>
  322. </applications>
  323. <valuemap>
  324. <name>Yunohost : Service state</name>
  325. </valuemap>
  326. <trigger_prototypes>
  327. <trigger_prototype>
  328. <expression>{last()}=0</expression>
  329. <name>TCP port {#PORT} not responding</name>
  330. <priority>HIGH</priority>
  331. <manual_close>YES</manual_close>
  332. </trigger_prototype>
  333. </trigger_prototypes>
  334. </item_prototype>
  335. </item_prototypes>
  336. </discovery_rule>
  337. <discovery_rule>
  338. <name>UDP Ports opened</name>
  339. <key>yunohost.ports.udp.discover</key>
  340. <delay>1d;h9m45</delay>
  341. <lifetime>0d</lifetime>
  342. <item_prototypes>
  343. <item_prototype>
  344. <name>Check UDP port {#PORT} listening</name>
  345. <key>net.udp.listen[{#PORT}]</key>
  346. <delay>900s</delay>
  347. <applications>
  348. <application>
  349. <name>Yunohost : Ports</name>
  350. </application>
  351. </applications>
  352. <valuemap>
  353. <name>Yunohost : Service state</name>
  354. </valuemap>
  355. <trigger_prototypes>
  356. <trigger_prototype>
  357. <expression>{last()}=0</expression>
  358. <name>UDP port {#PORT} not listening</name>
  359. <priority>HIGH</priority>
  360. <manual_close>YES</manual_close>
  361. </trigger_prototype>
  362. </trigger_prototypes>
  363. </item_prototype>
  364. </item_prototypes>
  365. </discovery_rule>
  366. <discovery_rule>
  367. <name>Yunohost services</name>
  368. <key>yunohost.services.discover</key>
  369. <delay>1d;h10m15</delay>
  370. <lifetime>7d</lifetime>
  371. <item_prototypes>
  372. <item_prototype>
  373. <name>Yunohost service {#SERVICE} status</name>
  374. <type>DEPENDENT</type>
  375. <key>yunohost.service.statusrunp[{#SERVICE}]</key>
  376. <delay>0</delay>
  377. <history>7d</history>
  378. <applications>
  379. <application>
  380. <name>Yunohost : Services</name>
  381. </application>
  382. <application>
  383. <name>Yunohost : Services : Status</name>
  384. </application>
  385. </applications>
  386. <valuemap>
  387. <name>Yunohost : services</name>
  388. </valuemap>
  389. <preprocessing>
  390. <step>
  391. <type>JSONPATH</type>
  392. <params>$.active</params>
  393. </step>
  394. <step>
  395. <type>REGEX</type>
  396. <params>(.*)
  397. \1:inactive=0:active=1:unknown=2;disabled=3</params>
  398. </step>
  399. <step>
  400. <type>REGEX</type>
  401. <params>^(inactive|active|unknown|disabled):(?=.*\1=(\d))
  402. \2</params>
  403. </step>
  404. </preprocessing>
  405. <master_item>
  406. <key>yunohost.service.status[{#SERVICE}]</key>
  407. </master_item>
  408. <trigger_prototypes>
  409. <trigger_prototype>
  410. <expression>{last()}=3</expression>
  411. <name>Service {#SERVICE} disabled</name>
  412. <priority>HIGH</priority>
  413. <manual_close>YES</manual_close>
  414. </trigger_prototype>
  415. <trigger_prototype>
  416. <expression>{last()}=0</expression>
  417. <name>Service {#SERVICE} state is inactive</name>
  418. <priority>HIGH</priority>
  419. <manual_close>YES</manual_close>
  420. </trigger_prototype>
  421. <trigger_prototype>
  422. <expression>{last()}=2</expression>
  423. <name>Service {#SERVICE} state is unknown</name>
  424. <priority>HIGH</priority>
  425. <manual_close>YES</manual_close>
  426. </trigger_prototype>
  427. </trigger_prototypes>
  428. </item_prototype>
  429. <item_prototype>
  430. <name>Yunohost service {#SERVICE} status (full)</name>
  431. <key>yunohost.service.status[{#SERVICE}]</key>
  432. <delay>15m</delay>
  433. <history>7d</history>
  434. <trends>0</trends>
  435. <value_type>CHAR</value_type>
  436. <applications>
  437. <application>
  438. <name>Yunohost : Services</name>
  439. </application>
  440. </applications>
  441. </item_prototype>
  442. </item_prototypes>
  443. </discovery_rule>
  444. <discovery_rule>
  445. <name>Yunohost users</name>
  446. <key>yunohost.users.discover</key>
  447. <delay>1d;h10m30</delay>
  448. <item_prototypes>
  449. <item_prototype>
  450. <name>Quota percent for user {#USERNAME}</name>
  451. <key>yunohost.user.quota[{#USERNAME}]</key>
  452. <delay>1h</delay>
  453. <history>30d</history>
  454. <units>%</units>
  455. <applications>
  456. <application>
  457. <name>Yunohost : Users</name>
  458. </application>
  459. </applications>
  460. <trigger_prototypes>
  461. <trigger_prototype>
  462. <expression>{last()}&gt;=80</expression>
  463. <name>User {#USERNAME} quota exceed 80%</name>
  464. <priority>AVERAGE</priority>
  465. <manual_close>YES</manual_close>
  466. </trigger_prototype>
  467. <trigger_prototype>
  468. <expression>{last()}&gt;=90</expression>
  469. <name>User {#USERNAME} quota exceed 90%</name>
  470. <priority>HIGH</priority>
  471. <manual_close>YES</manual_close>
  472. </trigger_prototype>
  473. </trigger_prototypes>
  474. </item_prototype>
  475. </item_prototypes>
  476. </discovery_rule>
  477. </discovery_rules>
  478. <macros>
  479. <macro>
  480. <macro>{$YUNOHOST.BACKUP.MAXDAYS}</macro>
  481. <value>7</value>
  482. <description>The oldest backup age in day before trigger</description>
  483. </macro>
  484. <macro>
  485. <macro>{$YUNOHOST.CERTIFICATE.REMAININGDAYS_AVG}</macro>
  486. <value>14</value>
  487. <description>Expiration date in X days AVG trigger</description>
  488. </macro>
  489. <macro>
  490. <macro>{$YUNOHOST.CERTIFICATE.REMAININGDAYS_DISASTER}</macro>
  491. <value>1</value>
  492. <description>Expiration date in X days DISASTER trigger</description>
  493. </macro>
  494. <macro>
  495. <macro>{$YUNOHOST.CERTIFICATE.REMAININGDAYS_HIGH}</macro>
  496. <value>7</value>
  497. <description>Expiration date in X days HIGH trigger</description>
  498. </macro>
  499. </macros>
  500. </template>
  501. </templates>
  502. <triggers>
  503. <trigger>
  504. <expression>{Template Yunohost:yunohost.migrations.lastavailable.last()}&lt;&gt;{Template Yunohost:yunohost.migrations.lastinstalled.last()}</expression>
  505. <name>YunoHost has migration in pending state</name>
  506. <priority>INFO</priority>
  507. <description>Check Yunohost documentation and &quot;yunohost/admin/#/tools/migrations/ &quot; url or &quot;sudo yunohost tools migrations migrate&quot; command</description>
  508. <manual_close>YES</manual_close>
  509. </trigger>
  510. </triggers>
  511. <value_maps>
  512. <value_map>
  513. <name>Yunohost : Service state</name>
  514. <mappings>
  515. <mapping>
  516. <value>0</value>
  517. <newvalue>Down</newvalue>
  518. </mapping>
  519. <mapping>
  520. <value>1</value>
  521. <newvalue>Up</newvalue>
  522. </mapping>
  523. </mappings>
  524. </value_map>
  525. <value_map>
  526. <name>Yunohost : certificates</name>
  527. <mappings>
  528. <mapping>
  529. <value>0</value>
  530. <newvalue>unknown</newvalue>
  531. </mapping>
  532. <mapping>
  533. <value>1</value>
  534. <newvalue>critical</newvalue>
  535. </mapping>
  536. <mapping>
  537. <value>2</value>
  538. <newvalue>warning</newvalue>
  539. </mapping>
  540. <mapping>
  541. <value>3</value>
  542. <newvalue>attention</newvalue>
  543. </mapping>
  544. <mapping>
  545. <value>4</value>
  546. <newvalue>good</newvalue>
  547. </mapping>
  548. <mapping>
  549. <value>5</value>
  550. <newvalue>great</newvalue>
  551. </mapping>
  552. </mappings>
  553. </value_map>
  554. <value_map>
  555. <name>Yunohost : services</name>
  556. <mappings>
  557. <mapping>
  558. <value>0</value>
  559. <newvalue>inactive</newvalue>
  560. </mapping>
  561. <mapping>
  562. <value>1</value>
  563. <newvalue>active</newvalue>
  564. </mapping>
  565. <mapping>
  566. <value>2</value>
  567. <newvalue>unknow</newvalue>
  568. </mapping>
  569. <mapping>
  570. <value>3</value>
  571. <newvalue>disabled</newvalue>
  572. </mapping>
  573. </mappings>
  574. </value_map>
  575. </value_maps>
  576. </zabbix_export>