Add sudoers file for Zabbix user.

Add monitoring for PowerParh with powermt.
Changes in README.md
This commit is contained in:
Kamil Porembiński 2014-11-22 23:28:26 +01:00
parent 320d8f0247
commit 7db14d4737
4 changed files with 345 additions and 3 deletions

View File

@ -6,7 +6,7 @@ Script and templates for Zabbix 2.2.x. and 2.4.x
- In Templates there are XML files ready to import using Zabbix GUI
- In zabbix_agentd.conf.d there are custom User Parameters (need to be installed on agent)
Templates was tested on Red Hat 5.x, 6.x and CentOS 5.x, 6.x. Common UserParameter were added to ```zabbix_agentd.conf.d/linux.conf``` file. Please add it to your own Zabbix Agent installation.
Templates was tested on Red Hat 5.x, 6.x and CentOS 5.x, 6.x. Common UserParameter were added to ```zabbix_agentd.conf.d/linux.conf``` file. Please add it to your own Zabbix Agent installation. Sometimes you need to use SUDO for UserParameter. All rules are in file ```sudoers.d/zabbix```.
Please let us know if you have any questions or concerns.
@ -19,7 +19,7 @@ Monitoring memory usage of APC (http://pecl.php.net/package/APC) module. File ``
Template App Brocade HBA
======
Monitoring for Network Adapters - Brocade. Template is usind Discovery to create Items and Triggers.
Monitoring for Network Adapters - Brocade. Template is usind Discovery to create Items and Triggers. You need also add SUDO for zabbix user: ```zabbix ALL=(ALL) NOPASSWD: /usr/bin/bcu```
Template App Nscd
======
@ -33,7 +33,12 @@ Monitoring memory usage of OPcache (http://php.net/manual/en/book.opcache.php).
Template App RabbitMQ
======
Monitoring RabbitMQ (http://www.rabbitmq.com/) basic parameters like queues, exchanges and memory usage. You need install PHP on server for monitoring RabbitMQ.
Monitoring RabbitMQ (http://www.rabbitmq.com/) basic parameters like queues, exchanges and memory usage. You need install PHP on server for monitoring RabbitMQ. You need also add SUDO for zabbix user:
```
zabbix ALL=(ALL) NOPASSWD: /usr/sbin/rabbitmqctl
zabbix ALL=(ALL) NOPASSWD: /usr/bin/php /etc/zabbix/bin/rabbit.php
```
Template App cPanel
======
@ -195,6 +200,10 @@ Dell Open Manage System Status
You need also add SUDO for zabbix user: ```zabbix ALL=(ALL) NOPASSWD: /opt/dell/srvadmin/bin/omreport```
Template App PowerPath
======
Template Security
======
Contains items related with basic linux security (iptables status, selinux status) and Fail2ban application. You need also add SUDO for zabbix user: ```zabbix ALL=(ALL) NOPASSWD: /sbin/iptables -L INPUT -n```

8
sudoers.d/zabbix Normal file
View File

@ -0,0 +1,8 @@
zabbix ALL=(ALL) NOPASSWD: /sbin/iptables -L INPUT -n
zabbix ALL=(ALL) NOPASSWD: /usr/sbin/nscd -g
zabbix ALL=(ALL) NOPASSWD: /usr/sbin/rabbitmqctl
zabbix ALL=(ALL) NOPASSWD: /usr/bin/php /etc/zabbix/bin/rabbit.php
zabbix ALL=(ALL) NOPASSWD: /opt/dell/srvadmin/bin/omreport
zabbix ALL=(ALL) NOPASSWD: /usr/bin/bcu
zabbix ALL=(ALL) NOPASSWD: /sbin/powermt
Defaults:zabbix !requiretty

View File

@ -0,0 +1,320 @@
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2014-11-22T21:34:26Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
<template>
<template>Template App PowerPath</template>
<name>Template App PowerPath</name>
<description/>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<applications>
<application>
<name>PowerPath</name>
</application>
</applications>
<items>
<item>
<name>Device state</name>
<type>0</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>powermt-device-state</key>
<delay>60</delay>
<history>7</history>
<trends>365</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>3</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>1 - alive&#13;
0 - other</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>PowerPath</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
</items>
<discovery_rules>
<discovery_rule>
<name>PowerPath paths</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>powermt-path-list</key>
<delay>3600</delay>
<status>0</status>
<allowed_hosts/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<delay_flex/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<filter>
<evaltype>0</evaltype>
<formula/>
<conditions/>
</filter>
<lifetime>3</lifetime>
<description/>
<item_prototypes>
<item_prototype>
<name>Path /dev/{#PATH} errors</name>
<type>0</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>powermt-path-errors[{#PATH}]</key>
<delay>60</delay>
<history>30</history>
<trends>365</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<delta>2</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>PowerPath</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item_prototype>
<item_prototype>
<name>Path /dev/{#PATH} mode</name>
<type>0</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>powermt-path-mode[{#PATH}]</key>
<delay>60</delay>
<history>7</history>
<trends>365</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>3</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>1 - active&#13;
0 - other</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>PowerPath</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item_prototype>
<item_prototype>
<name>Path /dev/{#PATH} state</name>
<type>0</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>powermt-path-state[{#PATH}]</key>
<delay>60</delay>
<history>7</history>
<trends>365</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>3</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>1 - alive&#13;
0 - other</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>PowerPath</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item_prototype>
</item_prototypes>
<trigger_prototypes>
<trigger_prototype>
<expression>{Template App PowerPath:powermt-path-errors[{#PATH}].max(#90)}&gt;0</expression>
<name>Errors on PowerPath /dev/{#PATH}</name>
<url/>
<status>0</status>
<priority>3</priority>
<description/>
<type>0</type>
</trigger_prototype>
<trigger_prototype>
<expression>{Template App PowerPath:powermt-path-mode[{#PATH}].last()}=0</expression>
<name>Powerpath /dev/{#PATH} mode problem</name>
<url/>
<status>0</status>
<priority>3</priority>
<description/>
<type>0</type>
</trigger_prototype>
<trigger_prototype>
<expression>{Template App PowerPath:powermt-path-state[{#PATH}].last()}=0</expression>
<name>Powerpath /dev/{#PATH} state problem</name>
<url/>
<status>0</status>
<priority>3</priority>
<description/>
<type>0</type>
</trigger_prototype>
</trigger_prototypes>
<graph_prototypes>
<graph_prototype>
<name>PowerPath /dev/{#PATH} errors</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>5</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template App PowerPath</host>
<key>powermt-path-errors[{#PATH}]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
</graph_prototypes>
<host_prototypes/>
</discovery_rule>
</discovery_rules>
<macros/>
<templates/>
<screens/>
</template>
</templates>
<triggers>
<trigger>
<expression>{Template App PowerPath:powermt-device-state.last()}=0</expression>
<name>PowerPath device problem</name>
<url/>
<status>0</status>
<priority>4</priority>
<description/>
<type>0</type>
<dependencies/>
</trigger>
</triggers>
</zabbix_export>

View File

@ -0,0 +1,5 @@
UserParameter=powermt-path-list, echo -e "{\n\"data\":["; sudo /sbin/powermt display dev=all | tail -n+9 | grep -v "^$" | awk '{ print "{\"{#PATH}\":\""$3"\" }," }' | head -c -2; echo -e "]\n}";
UserParameter=powermt-device-state, sudo /sbin/powermt display dev=all 2>&1 | grep -c state=alive
UserParameter=powermt-path-mode[*], sudo /sbin/powermt display dev=all 2>&1 | grep "$1" | awk '{ print $ 6 }' | grep -c active
UserParameter=powermt-path-state[*], sudo /sbin/powermt display dev=all 2>&1 | grep "$1" | awk '{ print $ 7 }' | grep -c alive
UserParameter=powermt-path-errors[*], sudo /sbin/powermt display dev=all | grep "$1" | awk '{ print $ 9 }'