We introduced a ping monitoring program in this article. In this article, we will start documenting our script by going over the main routine: use Time::Local; use Mail::Sendmail; use Net::Ping::External qw(ping); $pmwrap=0; while (6 ne 9){ # Loop forever… I don’t mind. system(“cp new.dnsf dnsfc”); # Each pass through the servers, copy dnsf again to […]
Ping Monitoring Over a WAN – Main Routine
Ping Monitoring Over a WAN – Check/Log Routines
In this article we introduced a ping monitoring perl script. We talked about the main routine in this article. Now, let’s go over the printtime() and ckserv() functions. The printtime function simply writes a timestamp to mon.txt: sub printtime{ open (PM,”>> mon.txt”); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); $mon++; $year=$year+1900; print PM “\n”.$mon.”/”.$mday.”/”.$year.”-“.$hour.”:”.$min.”\n”; close PM; } The >> in the […]
Ping Monitoring Over a WAN – Adding Perl Mods
A couple of modules that we use in our ping monitoring script are Mail::Sendmail and Net::Ping::External. To install these, use the CPAN shell to search for the available Sendmail mods: root@srv-1 root # perl -MCPAN -e shell Warning [/etc/inputrc line 28]: Re-binding char #27 from [F_ViEndInsert] to meta for [91 49 126] => BeginningOfLine. cpan […]
Ping Monitoring Over a WAN – pf and rf routines
Pf and rf are the two final subroutines we need to discuss for our Ping Monitoring Over a WAN perl script. Both modules use the Net::Ping::External module, which we chose because it works on Windows and GNU/Linux (and because of this, probably works on most every platform that perl runs on). Here is the pf […]
Make Windows Talk to Syslog
One of our networks has just a few production Windows servers on it, and a whole bunch of Linux boxes. Being a Unix sysadmin by trade and inclination, this situation is mostly dreamy except for one thing: auditing the event logs on the Windows servers. We can’t just put our head in the sand and […]
Graphical Ps With Xps
Xps shows *nix processes as a tree. The status is indicated by color. Compile and run: u-1@srv-1 xps $ ls xps-4.2.tar.gz u-1@srv-1 xps $ tar -xzf *.gz u-1@srv-1 xps $ cd xps* u-1@srv-1 xps-4.2 $ u-1@srv-1 xps-4.2 $ ./configure checking for a BSD-compatible install… /bin/install -c checking whether build environment is sane… yes checking for […]
Using Ps-watcher to Monitor Processes
Ps-watcher can run ps periodically and match patterns based on the output of ps. You can check for memory usage, number of processes, etc. Let’s grab the program and try to compile: [root@test psw]# ls ps-watcher-1.0.tar.gz [root@test psw]# tar -xzf *.gz [root@test psw]# cd ps* [root@test ps-watcher-1.0]# ls aclocal.m4 configure install-sh mkinstalldirs README touch.pl AUTHORS […]
Disabling Performance Counters on Windows
One extremely annoying thing to get alerted about in the Windows application logs are the Perflib errors: The Open Procedure for service “pcAnywhere” in DLL “C:\Program Files\ Symantec\pcAnywhere\PcaPerfCtrs.dll” failed. Performance data for this service will not be available. Status code returned is data DWORD 0. or: The Open Procedure for service “ISAPISearch” in DLL “QPerf.dll” […]
A Simple Perl Load Monitoring Script
I wondered how to monitor load on my GNU/Linux boxen. Sure, there are a lot of canned apps out there. But what if I wanted to use Perl? (IUD SIS, you must use Perl, cuz Perl’s the best… Readin’ from my Camel book like you wanted me… script the pain away…) Anyhoo… I wanna use […]
Monitoring Windows CPU Performance With Perl
The Win32::PerfLib module is a glorious way to extract performance data from Windows boxen. Check out this site for more information. We used perl 5.6.1. Here is a script that shows how to use this module: use Win32::PerfLib; $processor = 238; $proctime = 6; while (6 ne 9){ if(my $perflib = new Win32::PerfLib(‘srv-48’)){ $proc_ref0 = […]
Troubleshooting Slowness/Lockups Over a WAN or VPN
One problem with network monitoring is that latency and router performance do not tell the whole story. What you really want to know is if you can transfer data at the application level across the WAN/VPN. This is particularly useful if you are skimping on your connection to your remote offices by using DSL or […]
AreWeDown TCP Latency Tester
There is a service we wrote available at AreWeDown.com that will measure the network health of TCP connections. It does this by issuing two insert commands via a MySQL ODBC connection from a system service at 30 second intervals. The idea is that this can be loaded on XP workstations at client sites on the […]
B is for bash
Bash is a huge subject! The purpose of this article is demonstrate & explain some of the basics so you can write shell scripts and work at the command line more effectively. See also our article on Aliases and Functions in bash for ways to customize your environment. I recommend highly the bash man page!!! […]
C is for ch ch ch changes….
C is an extremely useful letter of the alphabet in Linux, especially when paired with an h. With these letters one can chown, chmod, chroot, and change lots of other things. One can even chkconfig. ***************************** chown – change ownership of a file. ***************************** Nothing too exciting to report here, but there are a couple […]
D is for df, du, dd
These three classic Unix utilities like to get their hands dirty with file systems. **************************************************** df – display disk space usage on mounted filesystems **************************************************** Every newbie sysadmin learns df right off the bat; it displays mounted file systems and the disk space usage on each. By default (in linux) it displays the statistics as […]
E is for Ext3fs Part 1
The ext3 filesystem now installs as the default file system in most Linux distributions. Essentially ext2 with journaling, ext3 retains the stability and robustness of ext2 while adding the much needed journal for high-availability. Part 1 of this article will discuss some filesystem basics and Part 2, some tips for working with the Linux native […]
E is for Ext3fs Part 2
In Part 1 of this article, we discussed some basics of the ext* filesystems in Linux. In this section we’ll have some good old filesystem fun. The most commonly used tools for working with Linux filesystems are mke2fs (create ext2/ext3 filesystem), tune2fs (adjust filesystem parameters) and e2fsck (check and repair filesystem.) ADD JOURNAL TO EXT2 […]
F is for Find
One-liners illustrating the use of the find command abound on the world wide web. The command’s operation is straight forward, but it has so many options that the man page always makes for fascinating reading. The find command is your friend whenever you need to *find* files based on name, size, file type, creation/access/modification time, […]
G is for grep
Like using the word “grok” in conversation, saying “grep” out loud brands you a SuperGeek, at least in the mundane reckoning of members of the “normal” population. They don’t understand that grep is simply an odd concatenation of the phrase “grab regular expression”; and even if they did know, it would mean nothing to them. […]
H is for Head, Tail, or Split the Difference
Head, tail and split are three of the most commonly used utilities on GNU/Linux systems for the manipulation of text files. They are tiny, sharp, and all possess some handy options of which even the experienced user may be unaware. Head returns the first lines of a file or standard input. By default, it outputs […]

