update templates

This commit is contained in:
HalbeBruno 2025-08-09 16:14:06 -03:00
parent f3be028656
commit 400b6b8a71
16 changed files with 1 additions and 4602 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
templates_old

0
README.md Normal file → Executable file
View File

0
mod/install.sh Normal file → Executable file
View File

0
sql/zbx_db_partitiong.sql Normal file → Executable file
View File

View File

@ -1,60 +0,0 @@
# Templates Huawei
**Template Huawei VRP-SNMP** - Informações básicas da "caixa"
**Template Huawei Resources NetEngine** Informações hardware
CPU Utilization
CPU Utilization (average 1 min)
CPU Utilization (average 5 min)
Memory total
Memory utilization
Fan Speed
Fan Status
PSU Slot Corrente
PSU Slot Power
PSU Slot Status
PSU Slot Voltagem
**Template Huawei Resources VirtualSystem SNMPv2** Informações de "hardware" do virtual system
CPU Utilization
Memory total
Memory utilization
**Template Huawei Interfaces SNMP** - Metricas e informaçòes das interfaces
Interface Bits received
Interface Bits sent
Interface Interface type
Interface Operational status
Interface Inbound packets discarded
Interface Inbound packets with errors
Interface Outbound packets discarded
Interface Outbound packets with errors
Interface Duplex status
Interface Speed
**Template Huawei BNG** - Metricas BNG
PPPoE Max sessions
Total Dual-Stack Online Num
Total IPv4 Online Num
Total IPv6 Online Num
Total PPPoE Online Num
**Template Huawei BGP** - Informações Peers BGP
Total IPv4 FIB Routes
Total IPv4 RIB Routes
Total IPv6 FIB Routes
BGP4 Peer(s)
**Template Huawei S5700-S6700 SNMP** - Informações sobre as MPU dos Switchs.
CPU Utilization
Memory total
Memory utilization

View File

@ -1,204 +0,0 @@
zabbix_export:
version: '7.0'
template_groups:
- uuid: 36bff6c29af64692839d077febfc7079
name: 'Templates/Network devices'
- uuid: b01bb96a1ed547e1a8770677a646aa3c
name: 'Templates IPv0'
templates:
- uuid: 24ddc6a9eda54bdb99c4aeb7022cd103
template: 'Template Huawei BGP - by IPv0'
name: 'Template Huawei BGP - by IPv0'
description: 'Template for Huawei VRP to monitor BGP sessions'
vendor:
name: IPv0
version: 7.0-1
groups:
- name: 'Templates/Network devices'
- name: 'Templates IPv0'
items:
- uuid: 2dc84ab8ef1c482cbb615197eec0314d
name: 'Total IPv4 FIB Routes'
type: SNMP_AGENT
snmp_oid: .1.3.6.1.2.1.4.24.3.0
key: hwIPv4FibRoutes
delay: 5m
history: 7d
trends: 30d
units: Prefixes
tags:
- tag: Application
value: 'Routing Table Info'
- uuid: 834909c6333e41388f89806f1555a42a
name: 'Total IPv4 RIB Routes'
type: SNMP_AGENT
snmp_oid: .1.3.6.1.4.1.2011.5.25.177.9.1.0
key: hwIPv4RibRoutes
delay: 5m
history: 7d
trends: 30d
units: Prefixes
tags:
- tag: Application
value: 'Routing Table Info'
- uuid: 9b3f36e9881446468f758a72a5088b7d
name: 'Total IPv6 FIB Routes'
type: SNMP_AGENT
snmp_oid: 1.3.6.1.2.1.55.1.9.0
key: hwIPv6FibRoutes
delay: 5m
history: 7d
trends: 30d
units: Prefixes
tags:
- tag: Application
value: 'Routing Table Info'
discovery_rules:
- uuid: 8a2ee36a480a46b4b6b115de4ed21529
name: 'BGP4 Peer(s)'
type: EXTERNAL
key: 'discovery_hw_bgp_peers.py["{HOST.CONN}","{$SNMP_COMMUNITY}","{$SNMP_PORTA}"]'
delay: 1h
enabled_lifetime_type: DISABLE_NEVER
description: 'discovery[{#BGPPEER},.1.3.6.1.4.1.2011.5.25.177.1.1.2.1.4.0,{#ASNUM},.1.3.6.1.4.1.2011.5.25.177.1.1.2.1.2.0,{#ADMSTATUS},.1.3.6.1.4.1.2011.5.25.177.1.1.2.1.11.0]'
item_prototypes:
- uuid: 5f3b6d48b21d448293e28d0afa949d5b
name: 'IP Peer AS{#ASNUM} ({#PEERNAME})'
type: SNMP_AGENT
snmp_oid: '.1.3.6.1.4.1.2011.5.25.177.1.1.2.1.4.0.{#SNMPINDEX}'
key: 'Bgp.Peer[{#SNMPINDEX}]'
delay: 1h
value_type: TEXT
trends: '0'
status: DISABLED
discover: NO_DISCOVER
tags:
- tag: bgp
value: peers
- tag: peer
value: '{#ASNUM}'
- uuid: 16d190973c3344419e313bc89b0af6d0
name: 'Uptime {#BGPPEER} - AS{#ASNUM} - ({#PEERNAME})'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.177.1.1.2.1.7.0.{#SNMPINDEX}'
key: 'BgpPeerFsmEstablishedTime[{#BGPPEER}]'
history: 30d
trends: 90d
units: uptime
tags:
- tag: bgp
value: peers
- tag: bgp
value: uptime
- tag: peer
value: '{#ASNUM}'
- uuid: e5cbcc63ee5c4646bb0c783314f1bf43
name: 'Prefixos {#BGPPEER} - AS{#ASNUM} - ({#PEERNAME})'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.177.1.1.3.1.1.0.{#SNMPINDEX}'
key: 'BgpPeerRoutes[{#BGPPEER}]'
history: 30d
trends: 90d
units: prefixes
tags:
- tag: bgp
value: peers
- tag: bgp
value: prefixos
- tag: peer
value: '{#ASNUM}'
- uuid: b195302e6eed4f56b00f01623dfa7271
name: 'Status {#BGPPEER} - AS{#ASNUM} - ({#PEERNAME})'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.177.1.1.2.1.5.0.{#SNMPINDEX}'
key: 'BgpPeerState[{#BGPPEER}]'
history: 30d
trends: 90d
valuemap:
name: BgpPeerState
tags:
- tag: bgp
value: peers
- tag: bgp
value: status
- tag: peer
value: '{#ASNUM}'
trigger_prototypes:
- uuid: 1b3049a16e7b4bd487ea83e7897139d9
expression: |
last(/Template Huawei BGP - by IPv0/BgpPeerState[{#BGPPEER}])<>6
and
last(/Template Huawei BGP - by IPv0/BgpPeerState[{#BGPPEER}],#2)=6
recovery_mode: RECOVERY_EXPRESSION
recovery_expression: 'last(/Template Huawei BGP - by IPv0/BgpPeerState[{#BGPPEER}])=6'
name: 'Peer {#BGPPEER} - AS{#ASNUM} - ({#PEERNAME}) is DOWN!'
priority: AVERAGE
manual_close: 'YES'
tags:
- tag: bgp-peer
timeout: 10s
tags:
- tag: ipv0
- tag: target
value: huawei
macros:
- macro: '{$SNMP_PORTA}'
value: '161'
valuemaps:
- uuid: e1fae0345e234608b70c9a389b654e0b
name: BgpPeerState
mappings:
- value: '1'
newvalue: idle
- value: '2'
newvalue: connect
- value: '3'
newvalue: active
- value: '4'
newvalue: opensent
- value: '5'
newvalue: openconfirm
- value: '6'
newvalue: established
graphs:
- uuid: eb7826ff54d043b4b928b6db4fb6d4ae
name: 'FIB - IPv4'
graph_items:
- sortorder: '1'
drawtype: FILLED_REGION
color: 00EE00
item:
host: 'Template Huawei BGP - by IPv0'
key: hwIPv4FibRoutes
- uuid: ee655f29b1784cdfa4b733d87f742379
name: 'FIB - IPv6'
graph_items:
- sortorder: '1'
color: F63100
item:
host: 'Template Huawei BGP - by IPv0'
key: hwIPv6FibRoutes
- uuid: 10ad7fa634e348538077986b6b4d5905
name: 'RIB - IPv4'
graph_items:
- sortorder: '1'
drawtype: FILLED_REGION
color: EE0000
item:
host: 'Template Huawei BGP - by IPv0'
key: hwIPv4RibRoutes
- uuid: 6da07b4c9eaf4814874c95ec9bd828c1
name: 'RIB x FIB - IPv4'
graph_items:
- sortorder: '1'
drawtype: BOLD_LINE
color: 00EE00
item:
host: 'Template Huawei BGP - by IPv0'
key: hwIPv4FibRoutes
- sortorder: '2'
drawtype: BOLD_LINE
color: EE0000
item:
host: 'Template Huawei BGP - by IPv0'
key: hwIPv4RibRoutes

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,258 +0,0 @@
zabbix_export:
version: '7.0'
template_groups:
- uuid: 36bff6c29af64692839d077febfc7079
name: 'Templates/Network devices'
- uuid: b01bb96a1ed547e1a8770677a646aa3c
name: 'Templates IPv0'
templates:
- uuid: d4b4f36537ee4a51a55a114c2fd325bd
template: 'Template Huawei Resources NetEngine SNMPv2 - by IPv0'
name: 'Template Huawei Resources NetEngine SNMPv2 - by IPv0'
vendor:
name: IPv0
version: 7.0-1
groups:
- name: 'Templates/Network devices'
- name: 'Templates IPv0'
items:
- uuid: 36af8ceb5cc74476b8de9a84b77877ee
name: 'Memory total'
type: SNMP_AGENT
snmp_oid: 1.3.6.1.4.1.2011.5.25.255.1.2.1.4.0.1.51
key: hwMemoryTotalSize
delay: 1d
history: 7d
trends: '0'
units: B
preprocessing:
- type: MULTIPLIER
parameters:
- '1024'
tags:
- tag: component
value: memory
- uuid: 8eadf5ec3bd643f6aa5e2d3ae5a6bbc9
name: 'Memory utilization'
type: SNMP_AGENT
snmp_oid: 1.3.6.1.4.1.2011.5.25.255.1.2.1.3.0.1.51
key: hwMemoryUsedSize
delay: '160'
history: 7d
units: B
preprocessing:
- type: MULTIPLIER
parameters:
- '1024'
tags:
- tag: component
value: memory
discovery_rules:
- uuid: a026aee9cdbd46d2bea3ad51408b3592
name: CPU
type: SNMP_AGENT
snmp_oid: 'discovery[{#SNMPVALUE},1.3.6.1.4.1.2011.6.3.4.1.3]'
key: hwCpuDevIndex
delay: 1h
lifetime: 1d
enabled_lifetime_type: DISABLE_NEVER
item_prototypes:
- uuid: 38f6158976474bc6bc312ab9bc1d438e
name: 'CPU Utilization (average 1 min)'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.6.3.4.1.3.{#SNMPINDEX}'
key: 'huaweihwAvgDuty1min[{#SNMPINDEX}]'
history: 7d
trends: 60d
units: '%'
tags:
- tag: component
value: cpu
- uuid: f6a524e990734db9bbd6c04f50f21545
name: 'CPU Utilization (average 5 min)'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.6.3.4.1.4.{#SNMPINDEX}'
key: 'huaweihwAvgDuty5min[{#SNMPINDEX}]'
delay: 5m
history: 7d
trends: 60d
units: '%'
tags:
- tag: component
value: cpu
trigger_prototypes:
- uuid: a90c2aa8f89d42c9b9a5bad9e456736c
expression: 'last(/Template Huawei Resources NetEngine SNMPv2 - by IPv0/huaweihwAvgDuty5min[{#SNMPINDEX}])>80'
name: 'CPU em {HOST.NAME} sobrecarregada'
priority: HIGH
manual_close: 'YES'
- uuid: b900c739bd8145868aa049d026b61fba
name: 'CPU Utilization'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.6.3.4.1.2.{#SNMPINDEX}'
key: 'huaweihwCpuDevDuty[{#SNMPINDEX}]'
history: 7d
trends: 60d
units: '%'
tags:
- tag: component
value: cpu
graph_prototypes:
- uuid: 63bc1ec9a68248e1b13fdab515ff9813
name: 'CPU slot {#SNMPINDEX}'
ymin_type_1: FIXED
graph_items:
- sortorder: '1'
color: 00C800
item:
host: 'Template Huawei Resources NetEngine SNMPv2 - by IPv0'
key: 'huaweihwCpuDevDuty[{#SNMPINDEX}]'
- sortorder: '2'
color: 0000C8
item:
host: 'Template Huawei Resources NetEngine SNMPv2 - by IPv0'
key: 'huaweihwAvgDuty1min[{#SNMPINDEX}]'
- sortorder: '3'
color: C80000
item:
host: 'Template Huawei Resources NetEngine SNMPv2 - by IPv0'
key: 'huaweihwAvgDuty5min[{#SNMPINDEX}]'
- uuid: b244eb5363fd40469152a3933b37bf6a
name: FAN
type: SNMP_AGENT
snmp_oid: 'discovery[{#SNMPVALUE},1.3.6.1.4.1.2011.5.25.31.1.1.10.1.1]'
key: hwEntityFan
delay: 1d
enabled_lifetime_type: DISABLE_NEVER
item_prototypes:
- uuid: 9c446d62e3d24f149087ae53d8224f8e
name: 'Fan {#SNMPVALUE} Speed'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.31.1.1.10.1.5.{#SNMPINDEX}'
key: 'hwEntityFanSpeed[{#SNMPINDEX}]'
delay: 3m
trends: '0'
units: '%'
description: 'MIB: HUAWEI-ENTITY-EXTENT-MIB'
tags:
- tag: component
value: fan
- uuid: a88bc8038c7e47d18b20908f00d4fe8a
name: 'Fan {#SNMPVALUE} Status'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.31.1.1.10.1.7.{#SNMPINDEX}'
key: 'hwEntityFanState[{#SNMPINDEX}]'
delay: 3m
trends: '0'
description: 'MIB: HUAWEI-ENTITY-EXTENT-MIB'
valuemap:
name: hwEntityFanState
tags:
- tag: component
value: fan
- uuid: c8f65f9e1c4642f0b004ceb0c908ee40
name: PSU
type: SNMP_AGENT
snmp_oid: 'discovery[{#PSU_SLOT},1.3.6.1.4.1.2011.5.25.31.1.1.18.1.1]'
key: hwEntityPwrSlot
delay: 1d
enabled_lifetime_type: DISABLE_NEVER
item_prototypes:
- uuid: 7c88bf4914c4438e93669a6f66ee4592
name: 'PSU Slot {#SNMPINDEX} Corrente'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.31.1.1.18.1.7.{#SNMPINDEX}.0'
key: 'hwEntityPwrCurrent[slot{#SNMPINDEX}]'
delay: 3m
units: A
preprocessing:
- type: MULTIPLIER
parameters:
- '0.001'
tags:
- tag: component
value: psu
- uuid: d494fab4536b439ba8c577bd5dd9e280
name: 'PSU Slot {#SNMPINDEX} Power'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.31.1.1.18.1.5.{#SNMPINDEX}.0'
key: 'hwEntityPwrPresent[slot{#SNMPINDEX}]'
delay: 3m
description: 'Este objeto indica estado da fonte.'
valuemap:
name: EntityPwrPresent
tags:
- tag: component
value: psu
trigger_prototypes:
- uuid: 6443ea3e5e27493a8bd3151841e35838
expression: 'last(/Template Huawei Resources NetEngine SNMPv2 - by IPv0/hwEntityPwrPresent[slot{#SNMPINDEX}])=0'
recovery_mode: RECOVERY_EXPRESSION
recovery_expression: 'last(/Template Huawei Resources NetEngine SNMPv2 - by IPv0/hwEntityPwrPresent[slot{#SNMPINDEX}])=1'
name: 'Falha de Energia na PSU Slot {#SNMPINDEX}'
priority: HIGH
manual_close: 'YES'
- uuid: 584047ff16b84c55a87445b5b270dea5
name: 'PSU Slot {#SNMPINDEX} Status'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.31.1.1.18.1.6.{#SNMPINDEX}.0'
key: 'hwEntityPwrState[slot{#SNMPINDEX}]'
delay: 3m
value_type: FLOAT
description: 'Este objeto indica estado da fonte.'
valuemap:
name: hwEntityPwrState
tags:
- tag: component
value: psu
- uuid: 1c47033e9ccc406c8ad08a77a95cb263
name: 'PSU Slot {#SNMPINDEX} Voltagem'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.31.1.1.18.1.8.{#SNMPINDEX}.0'
key: 'hwEntityPwrVoltage[slot{#SNMPINDEX}]'
delay: 3m
value_type: FLOAT
units: V
description: 'Este objeto indica a voltagem da energia. Unidade: mV'
preprocessing:
- type: MULTIPLIER
parameters:
- '0.001'
tags:
- tag: component
value: psu
preprocessing:
- type: STR_REPLACE
parameters:
- '.0'
- ''
tags:
- tag: ipv0
- tag: target
value: huawei
valuemaps:
- uuid: 50e8d45c9c44497fa9d6a4f76472a106
name: EntityPwrPresent
mappings:
- value: '1'
newvalue: present
- value: '2'
newvalue: ausent
- uuid: 4e2ad30de21e401784d77671008e6feb
name: hwEntityFanState
mappings:
- value: '1'
newvalue: normal
- value: '2'
newvalue: abnormal
- uuid: cf65fe172a8944d9af0f97f0e3fd57c8
name: hwEntityPwrState
mappings:
- value: '1'
newvalue: supply
- value: '2'
newvalue: notSupply
- value: '3'
newvalue: sleep
- value: '4'
newvalue: unknown

View File

@ -1,73 +0,0 @@
zabbix_export:
version: '7.0'
template_groups:
- uuid: 36bff6c29af64692839d077febfc7079
name: 'Templates/Network devices'
- uuid: b01bb96a1ed547e1a8770677a646aa3c
name: 'Templates IPv0'
templates:
- uuid: 9474486c7ae1458e84953276cd6e063b
template: 'Template Huawei Resources VirtualSystem SNMPv2 - by IPv0'
name: 'Template Huawei Resources VirtualSystem SNMPv2 - by IPv0'
description: 'Template para Virutal System Huawei.'
vendor:
name: IPv0
version: 7.0-1
groups:
- name: 'Templates/Network devices'
- name: 'Templates IPv0'
discovery_rules:
- uuid: 79b1e05d39d042d99075a3e87a9447b5
name: 'VS Discovery'
type: SNMP_AGENT
snmp_oid: 'discovery[{#SNMPVALUE},1.3.6.1.4.1.2011.5.25.255.1.1.1.1]'
key: vs.discovery
delay: 1h
lifetime: 1d
enabled_lifetime_type: DISABLE_NEVER
item_prototypes:
- uuid: 6c70b7d8e6b74174beef0061854187d2
name: 'CPU Utilization'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.255.1.2.1.2.{#SNMPINDEX}.1.51'
key: 'hwVSCPUUsage[{#SNMPINDEX}]'
history: 7d
units: '%'
tags:
- tag: component
value: cpu
- uuid: 607b99fcd96d4c66b53def43c3636e8f
name: 'Memory total'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.255.1.2.1.4.{#SNMPINDEX}.1.51'
key: 'hwVSMemoryTotalSize[{#SNMPINDEX}]'
delay: 1d
history: 7d
trends: '0'
units: B
preprocessing:
- type: MULTIPLIER
parameters:
- '1024'
tags:
- tag: component
value: memory
- uuid: 46349f7c64264b1cab850cfbc0761cfe
name: 'Memory utilization'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.255.1.2.1.3.{#SNMPINDEX}.1.51'
key: 'hwVSMemoryUsedSize[{#SNMPINDEX}]'
delay: '160'
history: 7d
units: B
preprocessing:
- type: MULTIPLIER
parameters:
- '1024'
tags:
- tag: component
value: memory
tags:
- tag: ipv0
- tag: target
value: huawei

View File

@ -1,74 +0,0 @@
zabbix_export:
version: '7.0'
template_groups:
- uuid: 36bff6c29af64692839d077febfc7079
name: 'Templates/Network devices'
- uuid: b01bb96a1ed547e1a8770677a646aa3c
name: 'Templates IPv0'
templates:
- uuid: c6fa87a5f124447d9b374bd19ba59619
template: 'Template Huawei S5700-S6700 SNMP - by IPv0'
name: 'Template Huawei S5700-S6700 SNMP - by IPv0'
vendor:
name: IPv0
version: 7.0-1
groups:
- name: 'Templates/Network devices'
- name: 'Templates IPv0'
discovery_rules:
- uuid: 6258ddd3cead4b17ab63f0d6afb2ec05
name: 'MPU Discovery'
type: SNMP_AGENT
snmp_oid: 'discovery[{#ENT_NAME},1.3.6.1.2.1.47.1.1.1.1.7]'
key: mpu.discovery
delay: 1h
filter:
conditions:
- macro: '{#ENT_NAME}'
value: 'MPU.*'
formulaid: A
enabled_lifetime_type: DISABLE_NEVER
item_prototypes:
- uuid: a4504a04e88b475596e5c83c76a229d9
name: '{#ENT_NAME}: CPU utilization'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.{#SNMPINDEX}'
key: 'hwEntityCpuUsage[{#SNMPINDEX}]'
history: 7d
units: '%'
tags:
- tag: component
value: cpu
- uuid: fc2f623b89b94675887702d1c94e8920
name: '{#ENT_NAME}: Memory utilization'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.7.{#SNMPINDEX}'
key: 'hwEntityMemUsage.[{#SNMPINDEX}]'
history: 7d
units: '%'
tags:
- tag: component
value: memory
- uuid: 16a793c27cc34a7b99fa394c7f47bdd1
name: '{#ENT_NAME}: Temperature'
type: SNMP_AGENT
snmp_oid: '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.11.{#SNMPINDEX}'
key: 'hwEntityTemperature[{#SNMPINDEX}]'
delay: 3m
history: 7d
units: °C
description: |
MIB: HUAWEI-ENTITY-EXTENT-MIB
The temperature for the {#SNMPVALUE}.
tags:
- tag: component
value: temperature
preprocessing:
- type: STR_REPLACE
parameters:
- Board
- ''
tags:
- tag: ipv0
- tag: target
value: huawei

File diff suppressed because it is too large Load Diff

View File

@ -1,97 +0,0 @@
# Proxmox VE Exporter
## Instale o Prometheus
cd /tmp && wget -4 -qO- https://git.ipv0.com.br/0/zabbix/raw/branch/master/templates/proxmox-prometheus-pve-exporter/install-prometheus.sh | bash
## Instale o Prometheus Proxmox VE Exporter
cd /tmp && wget -4 -qO- https://git.ipv0.com.br/0/zabbix/raw/branch/master/templates/proxmox-prometheus-pve-exporter/pve-exporter.sh | bash
Edite o arquivo /etc/prometheus/pve.yml e configure o acesso:
```
default:
user: pve-exporter@pve
password: senha1234
verify_ssl: false
```
Configurar os exports em /etc/prometheus/prometheus.yml
```
cp /etc/prometheus/prometheus.yml /etc/prometheus/prometheus.yml_BACKUP
pico /etc/prometheus/prometheus.yml
```
```
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# REGRAS DE ALERTA
rule_files:
- 'alerts/*.yml'
# CONFIGURACAO DO ALERTMANAGER
alerting:
alertmanagers:
- static_configs:
- targets: ['45.6.116.215:9093']
# VictoriaMetrics
remote_write:
- url: "http://45.6.116.215:8428/api/v1/write"
scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
- job_name: 'ceph'
scrape_interval: 30s
static_configs:
- targets: ['dmsv01.gtecnet.local:9283']
- targets: ['dmsv02.gtecnet.local:9283']
- targets: ['dmsv03.gtecnet.local:9283']
- targets: ['pve01.gtecnet.local:9283']
- targets: ['pve02.gtecnet.local:9283']
- targets: ['pve03.gtecnet.local:9283']
- targets: ['pve04.gtecnet.local:9283']
# TARGETS CLUSTER
- targets: ['172.27.31.21:9283', '172.27.31.22:9283', '172.27.31.23:9283']
labels:
cluster: cluster-gtecnet02
- targets: ['172.27.31.11:9283', '172.27.31.12:9283', '172.27.31.13:9283', '172.27.31.14:9283']
labels:
cluster: cluster-gtecnet01
- job_name: 'node'
scrape_interval: 15s
static_configs:
- targets: ['dmsv01.gtecnet.local:9100']
- targets: ['dmsv02.gtecnet.local:9100']
- targets: ['dmsv03.gtecnet.local:9100']
- targets: ['pve01.gtecnet.local:9100']
- targets: ['pve02.gtecnet.local:9100']
- targets: ['pve03.gtecnet.local:9100']
- targets: ['pve04.gtecnet.local:9100']
# Essa parte só é utilizada caso queira pegar informações das VMs
- job_name: 'pve'
static_configs:
- targets:
- gtecnet02
metrics_path: /pve
params:
module: [default]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9221 # PVE exporter.
```

View File

@ -1,59 +0,0 @@
#!/bin/bash
PROMETHEUS_VERSION="2.46.0"
wget https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VERSION}/prometheus-${PROMETHEUS_VERSION}.linux-amd64.tar.gz
tar -xzvf prometheus-${PROMETHEUS_VERSION}.linux-amd64.tar.gz
cd prometheus-${PROMETHEUS_VERSION}.linux-amd64/
# if you just want to start prometheus as root
#./prometheus --config.file=prometheus.yml
# Create user
useradd --no-create-home --shell /bin/false prometheus
# Create Directories
mkdir -p /etc/prometheus
mkdir -p /var/lib/prometheus
# Set ownership
chown prometheus:prometheus /etc/prometheus
chown prometheus:prometheus /var/lib/prometheus
# Copy binaries
cp prometheus /usr/local/bin/
cp promtool /usr/local/bin/
chown prometheus:prometheus /usr/local/bin/prometheus
chown prometheus:prometheus /usr/local/bin/promtool
# Copy config
cp -r consoles /etc/prometheus
cp -r console_libraries /etc/prometheus
# cp prometheus.yml /etc/prometheus/prometheus.yml
# Copy Soncini config
cd /etc/prometheus/
wget https://raw.githubusercontent.com/gsoncini/monitoring/main/Config/prometheus.yml
chown -R prometheus:prometheus /etc/prometheus/consoles
chown -R prometheus:prometheus /etc/prometheus/console_libraries
# Setup systemd
echo '[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus \
--config.file /etc/prometheus/prometheus.yml \
--storage.tsdb.path /var/lib/prometheus/ \
--web.console.templates=/etc/prometheus/consoles \
--web.console.libraries=/etc/prometheus/console_libraries
[Install]
WantedBy=multi-user.target' > /etc/systemd/system/prometheus.service
systemctl daemon-reload
systemctl enable prometheus

View File

@ -1,48 +0,0 @@
#!/bin/bash
#add user
useradd -s /bin/false pve-exporter
# pacotes e dependencias do python
apt update && apt install python3-venv python3-setuptools python3-dev python3-pip libffi-dev libssl-dev build-essential -y && apt install python3-pip -y
# Crie e ative o venv, instale o prometheus-pve-exporter
python3 -m venv /opt/prometheus-pve-exporter
source /opt/prometheus-pve-exporter/bin/activate
pip install prometheus-pve-exporter
deactivate
# criando yml do pve exporter
touch /etc/prometheus/pve.yml
echo '
default:
user: pve-exporter@pve
password: <password>
verify_ssl: false ' > /etc/prometheus/pve.yml
chown root:pve-exporter /etc/prometheus/pve.yml
chmod 640 /etc/prometheus/pve.yml
# set permissions
echo '[Unit]
Description=Prometheus Proxmox VE Exporter
Documentation=https://github.com/prometheus-pve/prometheus-pve-exporter
[Service]
Restart=always
User=pve-exporter
ExecStart=/opt/prometheus-pve-exporter/bin/pve_exporter --config.file /etc/prometheus/pve.yml
[Install]
WantedBy=multi-user.target' > /etc/systemd/system/prometheus-pve-exporter.service
# enable pve-exporter
systemctl daemon-reload
systemctl enable prometheus-pve-exporter.service
systemctl start prometheus-pve-exporter.service