I am trying to run the following Script on AIX Server. The script checks if first field is EFFECTIVE_TIME , if it is then it converts second field in readable format else it redirects entire line to $MAIL. Both the mentioned files exists prior to running the script
The $TMP and $MAIL File exists and the contents of $TMP are as follows :
I am getting following error from AIX 5.3.
Could someone please help. I am not getting errors on Red Hat Server but problem only on AIX.
Your script is providing effective timestamp in the below format where we are getting current timestamp :
Although as per the file we should get following timestamp after converting from epoch to human readable format : Sat Jul 17 01:40:18 2010
Thanks
Rahul
Moderator's Comments:
Please wrap all code, files, input & output/errors in CODE tags.
It makes them far easier to read and preserves multiple spaces for indentation and fixed width data.
Last edited by rbatte1; 11-05-2015 at 10:52 AM..
Reason: Added CODE & ICODE tags
AIX 5.3 has ksh93, but I don't have it anymore and can't say right now how "fresh" ksh93 there.
According to your script you're interested only in the strings which begin with EFFECTIVE_TIME as the 1st word. In awk we have 2 statements - the first statement is for the strings, which have EFFECTIVE_TIME as the 1st word, and the second statement is for all other strings.
In the second case (easiest case) we just print the string itself. It is usually done with print $0.
In the first case we have to transform UNIX seconds to "normal" representation of the date. AIX standard awk doesn't have function to work with time/date as GNU awk, but ksh93 has.
So based on the input data we form a new script, which will be executed by ksh and transforms timestamp. If you run the one-line without | ksh93, you will see the script written with awk. Something like:
With this last part | ksh93 we just say, that the script should be executed by ksh93.
There is an easier way without awk:
but in this case you will loose spaces between first word and the rest of the data, if you have more than 1 space character.
Hi
I'd like to ssh from an AIX OS server ( v5.3) to a Fabric OS server ( v6.1.2 ) without password.
I tried using dsa or rsa keys but it didn't work, the aix server still asked for the password.
Somebody help, please :(:(:( (8 Replies)
Hello,
I've set up email alerts on AIX Servers. so that i can get email notifications (via mail relay server) when ever there is abnormal behavior.
for example
1) my script monitors CPU/disk/memory etc... when it reaches high water ark, it will send an email alert.
2) disk usage alerts
3)... (5 Replies)
Hello people,
I'm facing some problems Installing AIX in my Power server 720
Well, to tell the truth my problem is in Virtual I/O (IVM) installation.
OBSERVE THAT I DON'T HAVE A HMC! By the way: I have the latest server Firmware!
I've done all the process in ASMI, then inserted and... (1 Reply)
I have a Perl script that worked fine before moving it to justhost.com. It was on a Windows/Apache server. Just host is using UNIX. Other Perl scripts on other sites that were also moved work fine so I know Perl is functioning.
The script is called cwrmail.pl and is located in my cgi-bin.
When I... (9 Replies)
Hi,
I'm trying to write a for loop to run through a list of servers and for each server copy a file to a backup file. But I can't seem to get it to run through my server list. It work for individual servers, please see below.
#!/bin/ksh
SSH_USERID=khcuser
webservers="server1 server2"
... (2 Replies)
i am new in AIX i am trying to write a script to take a backup for specific files on server to and check error log if backup success send email to administrator , script done except for sending mail , i try to configure sendmail on aix to use our exchange server to send emails but still get error... (0 Replies)
Hi,
I am a newbie to AIX. We have 2 AIX5.3 servers in our environment, I need to transfer some files in Binary mode from one server to another and some files in ASCII mode from one server to another server. Could you please help me as to how I need to do that?
Thanks,
Rakesh (4 Replies)
I have av script that loops through some statistic files to create a report. We would like to only loop through non-empty files as these files create an empty report-line.
I have figured out how to find the non-empty files, but not how to loop through only those files.
Here is the code that finds... (4 Replies)
Hi Friends
I am trying to install ssh in one of my AIX4.3 server.
I downloaded openssh and openssl from IBM site. While installing them openssh failed.
The lpcheck command display looks like this:
# lppchk -v
lppchk: The following filesets need to be installed or corrected to bring
... (5 Replies)
Hello,
I have a performance problem on an AIX box. I'm not sure what is causing this and hoping someone may have suggestions. Currently I'm noticing that cpu's are waiting while the box is in a idle state. I checked the disks and none of them are at 100%. If they were then I would understand... (3 Replies)