1825921 Members
2836 Online
109689 Solutions
New Discussion

Re: HP_UX11i

 
me4shiv
Occasional Advisor

HP_UX11i

Hi guys,

Can anybody help for below qry


How to monitor t user login in hp-ux 11i with repect to time and the ip as well how to get that log to a mailbox
6 REPLIES 6
Johnson Punniyalingam
Honored Contributor

Re: HP_UX11i

Use finger command , please see below for

Example :-
=========
$ finger ibmadm1 > point this output email addres
Login name: ibmadm1 (messages off)
Directory: /home/ibmadm1 Shell: /usr/bin/sh
On since Nov 20 11:15:12 on pts/ta from 10.8.86.10

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
me4shiv
Occasional Advisor

Re: HP_UX11i

hi Jhon,
Thanx for reply.

Do i need to enter this command whenever i need log?

OR

How i can automate this?

Thanks in advance

Me4Shiv
Suraj K Sankari
Honored Contributor

Re: HP_UX11i

Hi,
>>How to monitor t user login in hp-ux 11i with repect to time and the ip

last -R

last -R |mailx -s "user details " jsmith@abc.com


>>get that log to a mailbox
Demonstrate how to send an email from UNIX using mailx.
############################################################


# Example 1 - Simple:
echo "This is the body."| mailx -s "mailx Test1" jsmith@abc.com


# Example 2 - Using Variables:
SUBJECT="mailx Test2"
EMAIL_ADDRESS="jsmith@abc.com"
BODY="This is the body of the message."

echo "$BODY" | mailx -s "$SUBJECT" "$EMAIL_ADDRESS"


# Example 3 - Attached File:
SUBJECT="mailx Test3"
EMAIL_ADDRESS="jsmith@abc.com"
BODY="This is the body of the message."
ATTACHED_FILE="/etc/hosts"

cat "$ATTACHED_FILE" | mailx -s "$SUBJECT" "$EMAIL_ADDRESS"



Suraj
me4shiv
Occasional Advisor

Re: HP_UX11i

Hi Suraj,

Its gr8 wat you told me but one more thing after doing thiall stuffs still mails not in my mailbox yar, how do i ceckout that hp-ux box is connected to internet

Thanx
Shiv
Johnson Punniyalingam
Honored Contributor

Re: HP_UX11i

Hi,

you check if send sendmail service running

# ps -ef |grep sendmail

# sendmail -v jsmith@abc.com


Thx
Johnson
Problems are common to all, but attitude makes the difference
me4shiv
Occasional Advisor

Re: HP_UX11i

Hi jhon,

Sendmail is running

ps -ef |grep sendmail
root 1772 1 0 Nov 15 ? 1:11 sendmail: accepting connections
root 1714 1695 1 12:09:01 pts/0 0:00 grep sendmail

Still m gettng an error, says,

gmail.com: Name server timeout
me4shiv@gmail.com... Transient parse error -- message queued for future delivery

Could you help me pls.

thx
Shiv