On some versions of Linux and Solaris (possibly old Solaris versions), a process accounting scheme can be made available. I know that I once used this mechanism on Sun boxes to tabulate command usage ... cheers, drl
Can I do it like this?
if (strcmp(argv, "history")==0)
{
argv = "10";
execvp(argc,argv);
}
actually, it doesn't work,
How can I modify it?
Thanks (17 Replies)
hi
I want to know how to save all the command used by all the used under a particular root with the time stamp in a file.
Eg:
User Name: UX10
Time: 10:56
Command: LS
User Name: UX23
Time: 10:59
Command: MORE abc.txt
-Anand (2 Replies)
Like the topic says, does anyone know if it is possible to check to see when an FTP only user has logged in? Because the shell is /bin/false and they are only using FTP to access the system doing a "finger" or "last" it says they have never logged in.
Is there a way to see when ftp users log in... (1 Reply)
dear all ,
I m new to shell programming and I need your help.
Actually i want to keep track of all the commands executed in a bash prompt of users ,
very much in same manner as it is displayed when we run "history" command.
now the users are smart enough as they delete their history by... (6 Replies)
Hi, i suddenly realized that a directory is deleted unfortunately there are many user have pervilages on this directory
is there a way to track the user who delete this directory
or atleast from now can i enable something so that i can track from now
I think there is way from... (2 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
The task is to measure the density of users that are logged on system. The program
should check that every 30... (7 Replies)
I'm looking for a way to track commands that are run as root after a user runs sudo su - root. I have a profile set up for root that will track the commands by userid but if we change the shell it only stores it in that shells history file. (2 Replies)
Hi All
Please can you help me with the following issue:
A certain vendor installed an application in which for a user to log in; the user must use a user created/predefined by the application. And because this application has more than one user its difficult to track who did what and when,... (6 Replies)
Hi All
We have a job which writes files to a server at a particular time. The files will be created by a particular user ID
Today, during the execution of the job, it created a file to the server and the file sat on the server for sometime, but was deleted immediately at the end of the... (4 Replies)
Hi
I need to track what commands run in login session in solaris whether it is root or any normal users in bash shell.
My actual requirement is that when a user (nomal/root) login into the system, whatever commands he run, it should log into file on specified path . I don't require command... (4 Replies)
Discussion started by: hb00
4 Replies
LEARN ABOUT REDHAT
acct
ACCT(2) Linux Programmer's Manual ACCT(2)NAME
acct - switch process accounting on or off
SYNOPSIS
#include <unistd.h>
int acct(const char *filename);
DESCRIPTION
When called with the name of an existing file as argument, accounting is turned on, records for each terminating process are appended to
filename as it terminates. An argument of NULL causes accounting to be turned off.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
EACCES Write permission is denied for the specified file.
EACCES The argument filename is not a regular file.
EFAULT filename points outside your accessible address space.
EIO Error writing to the file filename.
EISDIR filename is a directory.
ELOOP Too many symbolic links were encountered in resolving filename.
ENAMETOOLONG
filename was too long.
ENOENT The specified filename does not exist.
ENOMEM Out of memory.
ENOSYS BSD process accounting has not been enabled when the operating system kernel was compiled. The kernel configuration parameter con-
trolling this feature is CONFIG_BSD_PROCESS_ACCT.
ENOTDIR
A component used as a directory in filename is not in fact a directory.
EPERM The calling process has no permission to enable process accounting.
EROFS filename refers to a file on a read-only file system.
EUSERS There are no more free file structures or we ran out of memory.
CONFORMING TO
SVr4 (but not POSIX). SVr4 documents an EBUSY error condition, but no EISDIR or ENOSYS. Also AIX and HPUX document EBUSY (attempt is made
to enable accounting when it is already enabled), as does Solaris (attempt is made to enable accounting using the same file that is cur-
rently being used).
NOTES
No accounting is produced for programs running when a crash occurs. In particular, nonterminating processes are never accounted for.
Linux 2.1.126 1998-11-04 ACCT(2)