Skip to content

Commit

Permalink
Create python2 packages
Browse files Browse the repository at this point in the history
  • Loading branch information
scoopex committed Mar 14, 2018
1 parent 384e702 commit 6076342
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 73 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ deploy:
secure: kySI7Haw3FrObyZQXW1lL6wY6ONJPZWIvKAPkOh1ZMsm4nubHOeQt4+zGL1mk3pVCNmSZUxjiQyPN5o74UCuWsObQZcbfxrEVJQ5MaBEIom7HNG0Uyw1tHO5jJJR3U+0MuVse4TtUPnM86tdMGSLJZqPOg6A1t+ORsPnjNoEizLtyeF84TiXjAnCQtx9XiL6tglT2mUYZKgTQMiKyFPmUtNTetQf/TKr6oaM2w63hhf6sOyCIYtzqIFc4CDBYmiGj5sFGXlP9PnLNGQnkqTjpC3694vcy2Ak9WOCwa3qDsLKMIvd1B2olBTUAZbiUf8pWnTwfXWPVlYepuS6FdkKF+uE/Y/TTvX0WshegoLPhp8hnVFMQIkOSor68ZxjOa3u8SXwYlD5lNB6g6eXNQKBCiQ8lxeGwu0aH33lWfmAoQOJmWZM/Mjo0jT/bxP3Ry1FFD17SSX5wQSn27nvTmmSrC4HacLsoM7HrdoSE3ZhcV0jPnwL9FuGGnc5k28ggNyVlu5n/f2vXpH3WQ9mbTCTl6MMoC6E7K/kGQBmR230EOtRA7pvYuE71l689S5U9DQ+97uG9LZqk83lhmWzZOzjVXno9fvFjY9ypkCYhgxSTkl3VFghTYRfEEONjoLGr0TKFkrz4QuNUBFqO/5IG1w+mUyxmEeAAihL8Odv9xiNYpM=
file_glob: true
file:
- "zabbix-agent-extensions-*.noarch.rpm"
- "zabbix-agent-extensions_*_all.deb"
- "zabbix-agent-extensions*.noarch.rpm"
- "zabbix-agent-extensions*_all.deb"
skip_cleanup: true
on:
repo: scoopex/zabbix-agent-extensions
Expand Down
33 changes: 27 additions & 6 deletions create_packages
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ VERSION="${1:-$(git describe --abbrev=0 --tags)}"

prepare(){

PY="$1"

echo "***************************************************************************************************************************************"
echo "PREPARE"
set -e
Expand All @@ -19,6 +21,10 @@ prepare(){
cp -av ${SDIR}/tools/* ${TMPDIR}/usr/bin/
chmod 755 ${TMPDIR}/usr/bin/*

if [ "$PY" = "2" ];then
sed -i '~s,#!/usr/bin/env python3,#!/usr/bin/env python,' ${TMPDIR}/usr/bin/*
fi

mkdir -p -m 755 ${TMPDIR}/usr/share/zabbix-agent-extensions/include.d/
cp -av ${SDIR}/agent-config/* ${TMPDIR}/usr/share/zabbix-agent-extensions/include.d/
sed -i "~s,VERSION TO BE REPLACED,${VERSION}," ${TMPDIR}/usr/share/zabbix-agent-extensions/include.d/zabbix_agent_extensions.conf
Expand All @@ -44,12 +50,19 @@ prepare(){

create_package(){
TYPE="$1"
PY="$2"

if [ "$PY" = "3" ];then
SUFFIX=""
else
SUFFIX="-python2"
fi
echo "***************************************************************************************************************************************"
echo "PACKAGE TYPE: $TYPE"
echo
set -x
fpm -s dir -t $TYPE \
-n zabbix-agent-extensions \
-n "zabbix-agent-extensions$SUFFIX" \
--license GPLv2 \
-a all \
--deb-no-default-config-files \
Expand All @@ -65,10 +78,10 @@ create_package(){
set +x

if [ "$TYPE" = "deb" ];then
dpkg -c zabbix-agent-extensions_*.deb
dpkg -c zabbix-agent-extensions${SUFFIX}_${VERSION}_all.deb
RET="$?"
elif [ "$TYPE" = "rpm" ];then
rpm -qlp zabbix-agent-extensions*.rpm
rpm -qlp zabbix-agent-extensions${SUFFIX}-${VERSION}-1.noarch.rpm
RET="$?"
fi
if [ "$RET" != "0" ];then
Expand Down Expand Up @@ -108,9 +121,17 @@ rm -rf zabbix-agent-extensions_*.deb zabbix-agent-extensions*.rpm
TMPDIR="$(mktemp -d)"
trap "rm -rf $TMPDIR" EXIT TERM INT

prepare
create_package deb
create_package rpm
prepare 3
create_package deb 3
create_package rpm 3
rm -rf $TMPDIR
trap "" EXIT TERM INT

TMPDIR="$(mktemp -d)"
trap "rm -rf $TMPDIR" EXIT TERM INT
prepare 2
create_package deb 2
create_package rpm 2
create_docu

exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ <h2>Item Overview</h2>
<th>Type</th><th>Name</th><th>Key</th><th>Description</th><th>Interval (sec)</th><th>History Days</th><th>Trend Days</th>
</tr>
</table>
<h1>Discovery rule "Disk discovery"</h1>
<h1>Discovery rule "Disk detail discovery"</h1>
<table class="pretty">
<tr>
<th>Name</th><th>Value</th>
</tr>
<tr>
<td>Name</td><td>Disk discovery</td>
<td>Name</td><td>Disk detail discovery</td>
</tr>
<tr>
<td>Key</td><td>custom.vfs.discover_disks</td>
<td>Key</td><td>vfs.dev.discovery.detail</td>
</tr>
<tr>
<td>Type</td><td>
<p class="desc">Zabbix Agent</p>
<p class="desc">Zabbix Agent (active)</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -113,105 +113,105 @@ <h2>Item Overview</h2>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:IO:Currently Active</td><td><tt>custom.vfs.dev.io.active[{#DEVICENAME}]</tt></td><td>Field #12&#13;
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:IO:Currently Active</td><td><tt>custom.vfs.dev.io.active[{#DEVICENAME}]</tt></td><td>Field #12&#13;
Number of I/Os currently in progress.&#13;
The only field that should go to zero. Incremented as requests are given to appropriate struct request_queue and decremented as they finish.</td><td>60</td><td>30</td><td>365</td>
The only field that should go to zero. Incremented as requests are given to appropriate struct request_queue and decremented as they finish.</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:IO:ms</td><td><tt>custom.vfs.dev.io.ms[{#DEVICENAME}]</tt></td><td>Field #13&#13;
Number of milliseconds spent doing I/Os. This field increases so long as field #12 (custom.vfs.dev.io.active) is nonzero.</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:IO:ms</td><td><tt>custom.vfs.dev.io.ms[{#DEVICENAME}]</tt></td><td>Field #13&#13;
Number of milliseconds spent doing I/Os. This field increases so long as field #12 (custom.vfs.dev.io.active) is nonzero.</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:IO:Weight:ms</td><td><tt>custom.vfs.dev.weight.io.ms[{#DEVICENAME}]</tt></td><td>Field #14&#13;
Weighted number of milliseconds spent doing I/Os.&#13;
This field is incremented at each I/O start, I/O completion, I/O merge, or read of these stats by the number of I/Os in progress (field 12) times the number of milliseconds spent doing I/O since the last update of this field. This can provide an easy measure of both I/O completion time and the backlog that may be accumulating.</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Read:Merged</td><td><tt>custom.vfs.dev.read.merged[{#DEVICENAME}]</tt></td><td>Field #5&#13;
Number of reads merged.&#13;
Reads and writes which are adjacent to each other may be merged for efficiency. Thus two 4K reads may become one 8K read before it is ultimately handed to the disk, and so it will be counted (and queued) as only one I/O. This field lets you know how often this was done.</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Read:Bytes/sec</td><td><tt>custom.vfs.dev.read.sectors[{#DEVICENAME}]</tt></td><td>Field #6&#13;
This is the total number of sectors read successfully.</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Read:ms</td><td><tt>custom.vfs.dev.read.ms[{#DEVICENAME}]</tt></td><td>Field #7&#13;
Number of milliseconds spent reading&#13;
This is the total number of milliseconds spent by all reads (as measured from __make_request() to end_that_request_last()).</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Read:Bytes/sec [z]</td><td><tt>vfs.dev.read[{#DEVICENAME},sectors]</tt></td><td>This is the total number of sectors read successfully.</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Read:Ops per second</td><td><tt>custom.vfs.dev.read.ops[{#DEVICENAME}]</tt></td><td>Field #4&#13;
This is the total number of reads completed successfully.</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Read:Merged</td><td><tt>custom.vfs.dev.read.merged[{#DEVICENAME}]</tt></td><td>Field #5&#13;
Number of reads merged.&#13;
Reads and writes which are adjacent to each other may be merged for efficiency. Thus two 4K reads may become one 8K read before it is ultimately handed to the disk, and so it will be counted (and queued) as only one I/O. This field lets you know how often this was done.</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Read:Bytes/sec</td><td><tt>custom.vfs.dev.read.sectors[{#DEVICENAME}]</tt></td><td>Field #6&#13;
This is the total number of sectors read successfully.</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Read:ms</td><td><tt>custom.vfs.dev.read.ms[{#DEVICENAME}]</tt></td><td>Field #7&#13;
Number of milliseconds spent reading&#13;
This is the total number of milliseconds spent by all reads (as measured from __make_request() to end_that_request_last()).</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:IO:Weight:ms</td><td><tt>custom.vfs.dev.weight.io.ms[{#DEVICENAME}]</tt></td><td>Field #14&#13;
Weighted number of milliseconds spent doing I/Os.&#13;
This field is incremented at each I/O start, I/O completion, I/O merge, or read of these stats by the number of I/Os in progress (field 12) times the number of milliseconds spent doing I/O since the last update of this field. This can provide an easy measure of both I/O completion time and the backlog that may be accumulating.</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Read:ms [z]</td><td><tt>vfs.dev.read[{#DEVICENAME},ops]</tt></td><td>This is the total number of milliseconds spent by all reads (as measured from __make_request() to end_that_request_last()).</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Write:Merged</td><td><tt>custom.vfs.dev.write.merged[{#DEVICENAME}]</tt></td><td>Field #9&#13;
Number of writes merged.&#13;
Reads and writes which are adjacent to each other may be merged for efficiency. Thus two 4K reads may become one 8K read before it is ultimately handed to the disk, and so it will be counted (and queued) as only one I/O. This field lets you know how often this was done.</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Read:Ops per second</td><td><tt>custom.vfs.dev.read.ops[{#DEVICENAME}]</tt></td><td>Field #4&#13;
This is the total number of reads completed successfully.</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Write:ms</td><td><tt>custom.vfs.dev.write.ms[{#DEVICENAME}]</tt></td><td>Field #11&#13;
Number of milliseconds spent writing.&#13;
This is the total number of milliseconds spent by all writes (as measured from __make_request() to end_that_request_last()).</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Read:Ops per second [z]</td><td><tt>vfs.dev.read[{#DEVICENAME},operations]</tt></td><td>This is the total number of reads completed successfully.</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Write:Ops per second</td><td><tt>custom.vfs.dev.write.ops[{#DEVICENAME}]</tt></td><td>Field #8&#13;
This is the total number of writes completed successfully.</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Write:Bytes/sec</td><td><tt>custom.vfs.dev.write.sectors[{#DEVICENAME}]</tt></td><td>Field #10&#13;
This is the total number of sectors written successfully.</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Write:Bytes/sec</td><td><tt>custom.vfs.dev.write.sectors[{#DEVICENAME}]</tt></td><td>Field #10&#13;
This is the total number of sectors written successfully.</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Write:Bytes/sec [z]</td><td><tt>vfs.dev.write[{#DEVICENAME},sectors]</tt></td><td>This is the total number of sectors read successfully.</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Read:Ops per second [z]</td><td><tt>vfs.dev.read[{#DEVICENAME},operations]</tt></td><td>This is the total number of reads completed successfully.</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Write:Merged</td><td><tt>custom.vfs.dev.write.merged[{#DEVICENAME}]</tt></td><td>Field #9&#13;
Number of writes merged.&#13;
Reads and writes which are adjacent to each other may be merged for efficiency. Thus two 4K reads may become one 8K read before it is ultimately handed to the disk, and so it will be counted (and queued) as only one I/O. This field lets you know how often this was done.</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Read:ms [z]</td><td><tt>vfs.dev.read[{#DEVICENAME},ops]</tt></td><td>This is the total number of milliseconds spent by all reads (as measured from __make_request() to end_that_request_last()).</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Write:ms</td><td><tt>custom.vfs.dev.write.ms[{#DEVICENAME}]</tt></td><td>Field #11&#13;
Number of milliseconds spent writing.&#13;
This is the total number of milliseconds spent by all writes (as measured from __make_request() to end_that_request_last()).</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Read:Bytes/sec [z]</td><td><tt>vfs.dev.read[{#DEVICENAME},sectors]</tt></td><td>This is the total number of sectors read successfully.</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Write:ms [z]</td><td><tt>vfs.dev.write[{#DEVICENAME},ops]</tt></td><td>This is the total number of milliseconds spent by all reads (as measured from __make_request() to end_that_request_last()).</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Write:Ops per second [z]</td><td><tt>vfs.dev.write[{#DEVICENAME},operations]</tt></td><td>This is the total number of reads completed successfully.</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Write:Ops per second</td><td><tt>custom.vfs.dev.write.ops[{#DEVICENAME}]</tt></td><td>Field #8&#13;
This is the total number of writes completed successfully.</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Write:ms [z]</td><td><tt>vfs.dev.write[{#DEVICENAME},ops]</tt></td><td>This is the total number of milliseconds spent by all reads (as measured from __make_request() to end_that_request_last()).</td><td>60</td><td>7d</td><td>182d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
</td><td>Disk:$1:Write:Ops per second [z]</td><td><tt>vfs.dev.write[{#DEVICENAME},operations]</tt></td><td>This is the total number of reads completed successfully.</td><td>60</td><td>30</td><td>365</td>
<p class="desc">Zabbix Agent (active)</p>
</td><td>$1:Write:Bytes/sec [z]</td><td><tt>vfs.dev.write[{#DEVICENAME},sectors]</tt></td><td>This is the total number of sectors read successfully.</td><td>60</td><td>7d</td><td>182d</td>
</tr>
</table>
</body>
Expand Down
40 changes: 29 additions & 11 deletions zabbix_templates/3.4/documentation/custom-os-linux-hardware.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ <h2>Macro Overview</h2>
<tr>
<th>Name</th><th>Default</th>
</tr>
<tr>
<td>{$DISK_USAGE_PERCENT_ALARM}</td><td>97</td>
</tr>
<tr>
<td>{$MAXIMUM_NUMBER_RETRANSMISSIONS}</td><td>1</td>
</tr>
<tr>
<td>{$MAX_NTP_OFFSET_MS}</td><td>100</td>
</tr>
<tr>
<td>{$MIN_NTP_SERVER_COUNT}</td><td>2</td>
</tr>
<tr>
<td>{$MONITOR_LOAD_WARNING_MULT}</td><td>5</td>
</tr>
<tr>
<td>{$MONITOR_TIMEOUT}</td><td>14400</td>
</tr>
</table>
<h1>Static Elements</h1>
<h2>Trigger Overview</h2>
Expand Down Expand Up @@ -71,7 +89,7 @@ <h1>Discovery rule "Hard Disk discovery"</h1>
</tr>
<tr>
<td>Type</td><td>
<p class="desc">Zabbix Agent</p>
<p class="desc">Zabbix Agent (active)</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -108,52 +126,52 @@ <h2>Item Overview</h2>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
<p class="desc">Zabbix Agent (active)</p>
</td><td>{#BLOCKDEVICE} Smart Health Status</td><td><tt>hardware.disk.health[{#BLOCKDEVICE}]</tt></td><td></td><td>10m</td><td>60d</td><td>0</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
<p class="desc">Zabbix Agent (active)</p>
</td><td>{#BLOCKDEVICE}: ID 197 Current_Pending_Sector</td><td><tt>hardware.disk.smart.attributes[{#BLOCKDEVICE},Current_Pending_Sector]</tt></td><td></td><td>2h</td><td>1w</td><td>0</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
<p class="desc">Zabbix Agent (active)</p>
</td><td>{#BLOCKDEVICE}: ID 198 Offline_Uncorrectable</td><td><tt>hardware.disk.smart.attributes[{#BLOCKDEVICE},Offline_Uncorrectable]</tt></td><td></td><td>2h</td><td>1w</td><td>0</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
<p class="desc">Zabbix Agent (active)</p>
</td><td>{#BLOCKDEVICE}: ID 9 Power On Hours</td><td><tt>hardware.disk.smart.attributes[{#BLOCKDEVICE},Power_On_Hours]</tt></td><td></td><td>2h</td><td>1w</td><td>0</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
<p class="desc">Zabbix Agent (active)</p>
</td><td>{#BLOCKDEVICE}: ID 5 Reallocated Sectors Count</td><td><tt>hardware.disk.smart.attributes[{#BLOCKDEVICE},Reallocated_Sector_Ct]</tt></td><td></td><td>2h</td><td>1w</td><td>0</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
<p class="desc">Zabbix Agent (active)</p>
</td><td>{#BLOCKDEVICE}: ID 10 Spin_Retry_Count</td><td><tt>hardware.disk.smart.attributes[{#BLOCKDEVICE},Spin_Retry_Count]</tt></td><td></td><td>2h</td><td>1w</td><td>0</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
<p class="desc">Zabbix Agent (active)</p>
</td><td>{#BLOCKDEVICE}: ID 194 Temperature</td><td><tt>hardware.disk.smart.attributes[{#BLOCKDEVICE},Temperature_Celsius]</tt></td><td></td><td>10m</td><td>1w</td><td>90d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
<p class="desc">Zabbix Agent (active)</p>
</td><td>{#BLOCKDEVICE}: ID 199 UDMA_CRC_Error</td><td><tt>hardware.disk.smart.attributes[{#BLOCKDEVICE},UDMA_CRC_Error_Count]</tt></td><td></td><td>2h</td><td>1w</td><td>365d</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
<p class="desc">Zabbix Agent (active)</p>
</td><td>{#BLOCKDEVICE} Device model</td><td><tt>hardware.disk.smart.info[{#BLOCKDEVICE},Device Model]</tt></td><td></td><td>1d</td><td>90d</td><td>0</td>
</tr>
<tr>
<td>
<p class="desc">Zabbix Agent</p>
<p class="desc">Zabbix Agent (active)</p>
</td><td>{#BLOCKDEVICE} Serial Number</td><td><tt>hardware.disk.smart.info[{#BLOCKDEVICE},Serial Number]</tt></td><td></td><td>1d</td><td>90d</td><td>0</td>
</tr>
</table>
Expand Down

0 comments on commit 6076342

Please sign in to comment.