Sponsored Content
Top Forums Shell Programming and Scripting Help with Linux hardware fault script in Perl Post 302605317 by neilh1704 on Wednesday 7th of March 2012 08:30:59 AM
Old 03-07-2012
Help with Linux hardware fault script in Perl

Hello,

I am working on a Perl script to run from an AIX Nim server to extract hardware errors from our Linux server using various forms of grep statements -

I have all my hosts in a text file and a command is run from the nim server to each host to pull out data from /var/log/messages and compile it into an email.

I seem to be strruggling with the following line:

Code:
my $errRpt = `ssh $hostname "grep -s -e '$shortDate' -e '$shortDate2' /var/log/messages|egrep -v ssh|egrep -v cron|egrep -v 'su:'|egrep -v warn|egrep -v segfault|egrep -v success|egrep -v syslog|egrep -v passwd|egrep -v usersense|egrep -v -i patrol|egrep -v -m 10 multipath`;

in that I am getting thousands of multipath io messages and only want to print it in my report if it occurs once.

e.g.
Code:
Mar  6 00:00:09 sap7000 multipathd: sdd: tur checker reports path is down
Mar  6 00:00:09 sap7000 multipathd: 360060e80100aec80053026d00000000e: switch to path group #1
Mar  6 00:00:14 sap7000 multipathd: sde: tur checker reports path is down
Mar  6 00:00:14 sap7000 multipathd: sdd: tur checker reports path is down
Mar  6 00:00:14 sap7000 multipathd: 360060e80100aec80053026d00000000e: switch to path group #1
Mar  6 00:00:19 sap7000 multipathd: sde: tur checker reports path is down
Mar  6 00:00:19 sap7000 multipathd: sdd: tur checker reports path is down
Mar  6 00:00:19 sap7000 multipathd: 360060e80100aec80053026d00000000e: switch to path group #1
Mar  6 00:00:24 sap7000 multipathd: sde: tur checker reports path is down
Mar  6 00:00:24 sap7000 multipathd: sdd: tur checker reports path is down


Is there a way I can do this through using egrep/grep? I have been using '-m' option but it doesn't seem to be helping.

i just want my script to produce a report from each server's messages file for those hardware faults but not filling up my mailbox.

Hope that makes sense.

Thanks
Neil.
 

8 More Discussions You Might Find Interesting

1. Red Hat

Segmentation fault on basic linux commands

Hello out there!!! I have a Red Hat Entreprise Linux 4 server and I am encountering this error # grep Segmentation Fault I know it is not the right use of grep command, but I did that just for testing purpose,then I did # which grep /bin/grep # ls -l /bin/grep -rwxr-xr-x 1 root... (4 Replies)
Discussion started by: inhaki
4 Replies

2. UNIX for Dummies Questions & Answers

Linux on custom hardware

I would like to configure a bare minimum Linux with internet browser on a system with Flash & RAM (but no harddisk or any other nonvolatile storage). Please advise. (5 Replies)
Discussion started by: rherb
5 Replies

3. Ubuntu

Ubuntu 10.04: Sybase with Perl Segmentation Fault

Hi, Operating System: Ubuntu 10.04 Other Packages Installed: freetds,DBI,DBD-Sybase I am trying to connect to SYBASE using perl programming..But the moment I am executing my perl program it throws a SEGMENTATION FAULT error. I have attached strace output for the same... Thanks for... (1 Reply)
Discussion started by: vnkatara
1 Replies

4. UNIX for Dummies Questions & Answers

With Linux do Hardware Brands Matter?

We have run software on Dell Servers w/ Windows and seen the performance degrade overtime. We switched to an IBM server w/ AIX and have not seen the same performance degradation over time. In fact, the IBM servers are at least five years old and continue to preform well at the same level. How... (2 Replies)
Discussion started by: bggibson
2 Replies

5. Red Hat

Red Hat linux fault information

Hi, I want to do some fault association analysis in red hat linux. who can tell me where I can get all of the fault information, and the detailed description about this fault information. Thank you very much. (4 Replies)
Discussion started by: zhaoyy
4 Replies

6. Shell Programming and Scripting

Segmentation fault in Unix shell (linux OS)

Hi, I am trying to run an online downloaded tool but I am having an eror segmentation fault. ./multicoil test.seq Config file /home/kmohanas/MULTICOIL/multicoil_config window length 0 = 28 window length 1 = 28 multi_lib = 3 4 5 multi_lib = 2 3 4 pair_lib = 1 2 4 printfile =... (6 Replies)
Discussion started by: kaav06
6 Replies

7. Debian

Linux, Debian - Segmentation Fault problem.

Hi guys, first of all apologize for my English... I have a big problem with "Segmentation fault", when running my game server. Console: (gdb) bt full #0 0x0000000000000000 in ?? () No symbol table info available. #1 0x00007ffff702aca4 in std::basic_ostream<char,... (1 Reply)
Discussion started by: Arson.
1 Replies

8. Hardware

Does this hardware works with Linux

Hello folks, I pretend acquire this hardware: 1-Motherboard Asus Skt1151 - H110M-A/M.2 (https://www.asus.com/pt/Motherboards...cifications/); 2-Intel i5 6400 2.7Ghz QuadCore Skt1151; or 2-Intel i5 6500 3.2Ghz QuadCore Skt1151; 3-Dimm 8GB DDR4 Kingston CL15 2133Mhz; Obvious I pretend... (1 Reply)
Discussion started by: enodev
1 Replies
MULTIPATH(8)						   Linux Administrator's Manual 					      MULTIPATH(8)

NAME
multipath - Device mapper target autoconfig SYNOPSIS
multipath [-v verbosity] [-b bindings_file] [-d] [-h|-l|-ll|-f|-t|-F|-B|-c|-q|-r|-a|-A|-w|-W] [-p failover|multi- bus|group_by_serial|group_by_prio|group_by_node_name] [device] DESCRIPTION
multipath is used to detect multiple paths to devices for fail-over or performance reasons and coalesces them OPTIONS
-v level verbosity, print all paths and multipaths 0 no output 1 print the created or updated multipath names only, for use to feed other tools like kpartx 2 + print all info : detected paths, coalesced paths (ie multipaths) and device maps -h print usage text -d dry run, do not create or update devmaps -l show the current multipath topology from information fetched in sysfs and the device mapper -ll show the current multipath topology from all available information (sysfs, the device mapper, path checkers ...) -f flush a multipath device map specified as parameter, if unused -F flush all unused multipath device maps -t print internal hardware table to stdout -r force devmap reload -B treat the bindings file as read only -b bindings_file set user_friendly_names bindings file location. The default is /etc/multipath/bindings -c check if a block device should be a path in a multipath device -q allow device tables with queue_if_no_path when multipathd is not running -a add the wwid for the specified device to the wwids file -A add wwids from any kernel command line mpath.wwid parameters to the wwids file -w remove the wwid for the specified device from the wwids file -W reset the wwids file to only include the current multipath devices -p policy force new maps to use the specified policy: failover 1 path per priority group multibus all paths in 1 priority group group_by_serial 1 priority group per serial group_by_prio 1 priority group per priority value. Priorities are determined by callout programs specified as a global, per-con- troller or per-multipath option in the configuration file group_by_node_name 1 priority group per target node name. Target node names are fetched in /sys/class/fc_transport/target*/node_name. Existing maps are not modified. device update only the devmap the path pointed by device is in. device is in the /dev/sdb (as shown by udev in the $DEVNAME variable) or major:minor format. device may alternatively be a multipath mapname SEE ALSO
multipathd(8), multipath.conf(5), kpartx(8), udev(8), dmsetup(8) hotplug(8) AUTHORS
multipath was developed by Christophe Varoqui, <christophe.varoqui@opensvc.com> and others. July 2006 MULTIPATH(8)
All times are GMT -4. The time now is 01:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy