Category Archives: Scripts

Small routing script

In recent days I was confronted with a problem regarding the routing under Linux.

The request was to add a route on a Proxy ARP server.

The Linux OS does give you the possibility to do add a route, in an “automatic mode”, in ways like:

  • add a route on the interface configuration (it will be applied only when the interface will go on-line) – for example Ubuntu and SUSE Linux
  • add a route on the network start script
  • add a route in the static-routes file
  • add a route with a script on the ifup folder on the “/sbin/ifup” (here more details: http://www.comptechdoc.org/os/linux/howlinuxworks/linux_hlsysconfig.html)

But because this was a complicated setup I was forced to use a bash script under the “/sbin/ifup”.

The script looked like this:

#!/bin/sh
ROUTE_CMD=”/sbin/route”
DMZ_INTERFACE=”eth0″               #we should have an IP address on this network – 85.14.228.0/24
LAN_INTERFACE_1=”eth1″          #we should have an IP address on this network – 10.12.0.0/24
EXTIPADDR=”85.14.228.254″     #an dmz gateway
INTIPADDR=”10.12.0.254″           #all the internal traffic

$ROUTE_CMD add -host 85.14.228.248 gw $EXTIPADDR $DMZ_INTERFACE
$ROUTE_CMD add default gw $INTIPADDR $LAN_INTERFACE_1
exit 0

I hope that this is going to help you,

Mihai out!

Monitoring Keepalived with Nagios

This is one of the cases where the passive check of the Nagios monitoring system comes in handy as we need to be informed immediately when the Keepalived changes state. So you will need an NSCA system implemented with your Nagios configuration.

Studying the Keepalived configuration we found that the authors have implemented the option to run a script that when the state of the VRRP changes. The script I’m referring to is run under the “notify” option.

Continue reading

SCCM 2007 WMI Repository Corruption

I was troubleshooting the other days on a server that had these errors in the (C:\WINDOWS\(SysWOW64/system32)\CCM\Logs\) execmgr.log log.

  • Failed to instantiate VApp UI Server {00AAB372-0D6D-4976-B5F5-9BC7605E30BB} with error 0x8000401A
  • Failed to instantiate Updates UI Server {2D023958-73D0-4542-8AD6-9A507364F70E} with error 8000401a
  • Failed to instantiate UI Server 2 {E8425D59-451B-4978-A2AB-641470EB7C02} with error 8000401a
  • Failed to instantiate UI Server {C2F23AE4-82D8-456F-A4AF-A2655D8CA726} with error 8000401a
  • Continue reading

Nagios check_snmp INVERTER

This is my first plug-in made for Nagios. It was made in order to help the administrator to check via SNMP the inverse scale variables such as UPS line in voltage.

For example, one needs to know when the input voltage of an UPS drops to zero => an error, as the power line is in fault, but not having problems when the same check is 220V in normal conditions.

With the normal “check_snmp” you can’t check those limits, as the check will always be in error.

Usage:  ./check_snmp_inverter.sh -H <remote_host_IP> -C <comunity_string> -o <OID> -w <warning value> -c <critical value> -u <measure block> -l <label>

The critical value is the real value that one needs to set, for example: 0, and the warning value greater than the critical – ex: 240.

You can download it from here.

Nagios WMI Proxy

This is a sketch article in which I want to do a brief description of how to install a Windows WMI proxy and do the checks via WMI in your windows network.

The WMI Proxy is basically a Windows Server / Workstation that has NRPE_NT or NSClient++ (you need to change a bit the configurations) installed and from which with an administrative user can do checks to the windows network via the WMI.

WMI is also used as a check for some other products including but not limited to: SCCM, SCOM, Spiceworks, etc.

Continue reading

Check the Cisco CallManager and CallManager Express (=> 6):

You will need first to check the SNMP OID’s with your systems (see the UPS tutorial ) and enable on CCM hosts the SNMP string and checks. All the checks that I have done for this tutorial are from the file CISCO-CCM-MIB.my

Continue reading

Tutorial to monitor AROS & APC UPS-s via SNMP with NAGIOS

– UPDATED – 27.08.2010

I have inserted my first plug-in (you can get it from here) in this tutorial with the help of which we will check things like voltage in or the time that remains until the battery is finished.

Before you start this tutorial please make sure that your network responds to the same OID as here and that you have configured all the UPS-s to work with the snmp (note down your snmp community string). In my tests I used the standard powernet395.mib from APC and the rfc1628.mib for AROS.

Continue reading