This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script can be used to perform Zabbix Low-Level Discoveries of | |
# SNMP hosts on the network via the 'nmap', 'snmpget' and 'host' utilities. | |
# | |
# Advantages over normal network discovery: | |
# * Faster! | |
# * We can fetch the hostname via SNMP (no more IP based names when PTR records are missing) | |
# * We can use the highly flexible 'nmap' targetting | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
if not ('zabbix-tools-python-modules.zip' in sys.path): | |
sys.path.insert(0, 'packages.zip') | |
import getpass | |
from pyzabbix import ZabbixAPI | |
u = raw_input("Username: ") | |
p = getpass.getpass() | |
print "Connecting to zabbix" | |
zapi = ZabbixAPI("http://127.0.0.1/zabbix") | |
zapi.login(u, p) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// define the namespaces that we are interested in | |
$ns = array | |
( | |
'content' => 'http://purl.org/rss/1.0/modules/content/', | |
'wfw' => 'http://wellformedweb.org/CommentAPI/', | |
'dc' => 'http://purl.org/dc/elements/1.1/' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// define the namespaces that we are interested in | |
$ns = array | |
( | |
'content' => 'http://purl.org/rss/1.0/modules/content/', | |
'wfw' => 'http://wellformedweb.org/CommentAPI/', | |
'dc' => 'http://purl.org/dc/elements/1.1/' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set path | |
PATH=/opt/zabbix-gnomes/:$PATH | |
# Set params | |
ZGROUPS="05_Core_Network 06_User_Network" | |
# Loop through hosts | |
for line in $(zgetinventory.py -G $ZGROUPS -F name | sed 1d); do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set path | |
PATH=/opt/zabbix-gnomes/:$PATH | |
# Zabbix server | |
ZBXSERV="127.0.0.1" | |
# Set params | |
TEMPLATE="Template Cisco Catalyst Stack" | |
SERIAL_ITEMKEY="cswSwitchSerialNumber" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT item.title,year.attribute_val,item.s_item_type,GROUP_CONCAT(item_attribute.lookup_attribute_val SEPARATOR ', '),DATE(item_instance.update_on) INTO OUTFILE '/tmp/opendb_export.csv' FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' FROM item LEFT JOIN item_instance ON item.id=item_instance.item_id LEFT JOIN item_attribute ON item.id=item_attribute.item_id LEFT JOIN (SELECT item_id,attribute_val FROM item_attribute WHERE s_attribute_type="YEAR") year on item.id=year.item_id WHERE (item.s_item_type="DVD" AND item_attribute.s_attribute_type="DVD_REGION") OR (item.s_item_type="BLU-RAY" AND item_attribute.s_attribute_type="BD-REGION") GROUP BY item_attribute.item_id ORDER BY item_instance.update_on ASC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script discovers only interfaces with Admin status "up". | |
# | |
COMMUNITY="$1" | |
IP="$2" | |
# Set ifDescr tree | |
IFDESC=".1.3.6.1.2.1.2.2.1.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script counts the number of returned lines from an SNMP walk. | |
# | |
COMMUNITY="$1" | |
IP="$2" | |
OID="$3" | |
FILTER="$4" | |
# Disable mibs to save time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# vim: set ft=python : | |
try: | |
import readline | |
import ConfigParser | |
import os | |
import os.path | |
import sys |
OlderNewer