1833813 Members
2943 Online
110063 Solutions
New Discussion

log for activities

 
SOLVED
Go to solution
Fabian Briseño
Esteemed Contributor

log for activities

Hello guys.
need your advice.

I have a SAP instance running in a server, and here's what i want to do.

I want to create a log for eveytime SAP is brought down, And in this log I want to register the time and date that this happened and log the user that did it.

Can this be done gurus ?.
Knowledge is power.
8 REPLIES 8
Rick Garland
Honored Contributor

Re: log for activities

Doesn't SAP have some sort of activity log that indicates when it is brought down?

Also, you could use SUDO to allow specific users to stop the SAP. In the sudo.log will be the commands, time stamp, and the user.

Fabian Briseño
Esteemed Contributor

Re: log for activities

Doesn't SAP have some sort of activity log that indicates when it is brought down?

Also, you could use SUDO to allow specific users to stop the SAP. In the sudo.log will be the commands, time stamp, and the user.

yes it does have a log, but it only logs the most recent brought down time. and not a history of them.

What is SUDO?

Let's say that user1 and user2 are the only ones allowed to stop sap, how would i go about to doing this





Knowledge is power.
Rick Garland
Honored Contributor

Re: log for activities

SUDO is a utility that translates to SuperUser DO

Allows certain defined users the ability to execute defined commands as superuser.

SUDO is available from HP as a depot binary file. Readily available, no charge.

When the SAP crashes, you will have a log in the SAP activity log file. When a user stops SAP, have the user use SUDO then the command will be logged in the sudoers log file with the timestamp and $LOGNAME.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: log for activities

Sudo is a package that will allow normal users to run commands as another user (even root). It logs each of these activities so it is a good fit for your need. You also need to really restrict who is actually able to execute your SAP start/stop commands so that, for example, only root is allowed to execute (or write to) these files then you setup a sudo command to allow user1 and user2 (only) to execute these start/stop commands with an effective UID of 0.

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.8p9/

Study the documentation included with this package; everything will be explained there.

If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: log for activities

Shalom,

The sudo shipped with Internet Express is a bit more reliable than the one on the porting center. The depot has needed dependencies built in.

http://software.hp.com search for Internet Express search for sudo.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Fabian Briseño
Esteemed Contributor

Re: log for activities

Thanks for your quick replys rick and A. clay.

Guys can this be done without sudo?

also lets say that I accidentally stop SAP as the root user, would this also be recorded in the sudo log ?

Knowledge is power.
A. Clay Stephenson
Acclaimed Contributor

Re: log for activities

No, obviously anything not run under sudo would not be logged by sudo. You could create a wrapper script which does the logging and then calls the "real" SAP start/stop commands but the same problem exists --- root could still execute the real commands outside the wrapper. It is very difficult to prevent root from executing anything and removing all traces of his activity (for example, root could edit your log files and then change the timestamps on the file so that "nothing" ever happened).

Sudo is about as good a solution as you are going to find --- and if you can't trust your admins then SAP start/stop logging may be the least of your problems.

If it ain't broke, I can fix that.
Fabian Briseño
Esteemed Contributor

Re: log for activities

thanks guys for your advice.

everyone was a big help

see you later
Knowledge is power.