Sponsored Content
Full Discussion: HP IML log formatting
Top Forums Shell Programming and Scripting HP IML log formatting Post 302734079 by snoman1 on Wednesday 21st of November 2012 01:10:43 PM
Old 11-21-2012
HP IML log formatting

HP hardware
Linux SLES version 10
shell script, ksh or sh

I am taking the output of the IML log and ultimately want to find only entries 30 days old. I am getting some unexpected results along the way.


hpasmcli -s "SHOW IML"


Event: 4 Added: 06/12/2012 13:56
INFO: Maintenance Note - IML Cleared (iLO 3 user:hpfe).

Event: 5 Added: 06/23/2012 15:06
CRITICAL: CPU - Uncorrectable Machine Check Exception (Board 0, Processor 1, APIC ID 0x00000010, Bank 0x00000004, Status 0xFA000000'00070F0F, Address 0x00000000'00000000, Misc 0xC0040FFE'01000000).

Event: 6 Added: 06/23/2012 15:06
CRITICAL: CPU - Uncorrectable Machine Check Exception (Board 0, Processor 2, APIC ID 0x00000021, Bank 0x00000004, Status 0xBA000000'00070F0F, Address 0x00000000'00000000, Misc 0xC0040FFE'01000000).

Event: 7 Added: 06/23/2012 15:06
CAUTION: POST Messages - POST Error: The system experienced an unexpected reboot. The Integrated Management Log (IML) may contain an entry indicating additional information about this reboot..


Here is my code so far.

for LINE in `hpasmcli -s "SHOW IML" |sed "s/'//g" |xargs -L 2 |awk '{print $4, $5}'` ; do
echo $LINE
# date --date "${LINE}" +%s
done


I am using the xargs command to get each 2-line set all together on one line to make it easier to work with. The sed command is to remove an unclosed single quote.

when I run this script I get this.

06/12/2012
13:56
06/23/2012
15:06
06/23/2012
15:06
06/23/2012
15:06
Why is it wrapping the date and the time on 2 different lines? I want them all on the same line!!

# hpasmcli -s "SHOW IML" |sed "s/'//g" |xargs -L 2 |awk '{print $4, $5}'
06/12/2012 13:56
06/23/2012 15:06
06/23/2012 15:06
06/23/2012 15:06
Here is what it should look like.

Once I get this worked out I want to write the date as epoch at the end of the line, take today's date and go back 30 days and compare, dropping any line that is over 30 days long.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

formatting

I've been asking on IRC channels but no one answers me, I need to format my hard drive, normally it's just format c: but c doesn't exist, how do I format when I have linux mandrake installed. Please reply to this quickly, I'm kinda in a rush :( (1 Reply)
Discussion started by: darryll777
1 Replies

2. UNIX for Dummies Questions & Answers

formatting

is it possible to format a powerbook g4 mac? like totally erase the HD then pop in the Mac OS cd and it will boot up an install like windows or any linux? (5 Replies)
Discussion started by: xeron
5 Replies

3. UNIX for Dummies Questions & Answers

formatting

Hi Again Guys , Please i installed linux RH 6.1 on Toshiba , 10G , RAM=128 , 600 MHZ . After i installed linux i got many error messages , seems it was not installed correctly , also when i finished installation it did not ask me for the 2nd installation CD , and when i logged as root , i... (5 Replies)
Discussion started by: tamemi
5 Replies

4. Shell Programming and Scripting

Formatting the Log file

Hi, I am having one script to run the multiple offline programs simultaneously. On that script I want to format the log file (which I redirected the STDOUT to a file) in a standard format. I want to do this while running the program not later. How to do this? Pls do the needful. For example. ... (5 Replies)
Discussion started by: sharif
5 Replies

5. Shell Programming and Scripting

Formatting

I have next part of script: for i in $LIST do echo "`date +"%H:%M:%S"` Converting $i ..."; mysql -uroot some -sABe "ALTER TABLE $i ENGINE=$ENGINE"; done I want to get following output formatting: "OK" must be one under another :) ... (3 Replies)
Discussion started by: mirusnet
3 Replies

6. Shell Programming and Scripting

formatting

I have file with different columns for ex. contents of file "txt" NAME AGE MARKS HARRY 23 89 TOM 12 67 BOB 23 11 and you see its not formatted.Now, I need the file "txt" to be formatted like COLUMN1 COLUMN2 COLUMN3 NAME AGE ... (3 Replies)
Discussion started by: vijay_0209
3 Replies

7. Shell Programming and Scripting

Formatting

Is there a way to make a 2 column output out of the following : 1 2 3 4 5 6 Output : 1 2 3 4 5 6 Thanks, Prasanna (3 Replies)
Discussion started by: prasanna1157
3 Replies

8. Shell Programming and Scripting

help formatting

I need to format a txt file and convert it in CSV. Any "future" column is separated by a newline. FROM: XS1 1.43294 0.0 XS2 1.21824 0.0 TO: XS1,XS2 (2 Replies)
Discussion started by: alfreale
2 Replies

9. Shell Programming and Scripting

Formatting

Good day All, I have requirement where my input data looks like below ] Message5 Expecting Output as 04/MAR/2104 ||| 23:15:45 ||| servername ||| NOTIFICATION |||message1||||||userId|||||| Message5 I could not use space delimiter as in the messages I would be having them as... (2 Replies)
Discussion started by: Tomlight
2 Replies

10. Shell Programming and Scripting

Help with formatting

Hi, I am new to UNIX and need your help in formatting the below input command to the desire output Input: CREATE UNIQUE INDEX XPKTABLE1 ( COL1, COL2 ) ON TABLE_NM; Output: COMMENT ON TABLE DB_NM.TABLE_NM AS 'PK=,COL1,COL2; '; In... (14 Replies)
Discussion started by: varun2327
14 Replies
condor_router_history(1)				      General Commands Manual					  condor_router_history(1)

Name
       condor_router_history Display - the history for routed jobs

Synopsis
       condor_router_history [ -- h]

       condor_router_history[ -- show_records] [ -- show_iwd] [ -- agedays] [ -- daysdays] [ -- start"YYYY-MM-DD HH:MM"]

Description
       condor_router_history  summarizes  statistics  for routed jobs over the previous 24 hours. With no command line options, statistics for run
       time, number of jobs completed, and number of jobs aborted are listed per route (site).

Options
       --h

	  Display usage information and exit.

       --show_records

	  Displays individual records in addition to the summary.

       --show_iwd

	  Include working directory in displayed records.

       --age days

	  Set the ending time of the summary to be daysdays ago.

       --days days

	  Set the number of days to summarize.

       --start YYYY-MM-DD HH:MM

	  Set the start time of the summary.

Exit Status
       condor_router_history will exit with a status of 0 (zero) upon success, and non-zero otherwise.

Author
       Condor Team, University of Wisconsin-Madison

Copyright
       Copyright (C) 1990-2012 Condor Team, Computer Sciences Department, University of  Wisconsin-Madison,  Madison,  WI.  All  Rights  Reserved.
       Licensed under the Apache License, Version 2.0.

       See the Condor Version 7.8.2 Manualor http://www.condorproject.org/licensefor additional notices. condor-admin@cs.wisc.edu

								  September 2012					  condor_router_history(1)
All times are GMT -4. The time now is 10:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy