UNIX user monitoring tools


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers UNIX user monitoring tools
# 1  
Old 04-09-2013
UNIX user monitoring tools

Hello mates..
i need help with these things
*Users should be allowed to login only once, i.e Multiple logins from single user should be restricted and should issue an alert if any user tries .
*statistics of everyday log in time ,duration of login,and the commands executed by the user
*Alert if the user is initiating more than 5 process in interval of 5minutes and also alert if any process of the user runs for more than 5mins.
# 2  
Old 04-09-2013
This is a tough one. Also, number 3 is totally unrealistic - normal operations on a unix box can do 10 processes in 10 seconds.

You need to define what you mean by processes. A harmless command like this:
Code:
find . -name foo | grep -v '[:digit:]' | sort | cut -c 1-3 > newfile

uses four processes in a few seconds. If users are locked into a menuing system then you can "count" each menu selection as a process. Almost every command you enter into UNIX creates at least one new process.

You can get most of what you ask by using the script command in the user's login
Code:
.profile

with something to detect multiple logins

Code:
trap 2 3
count=$(who | grep -cF " $USER ")
if [ $cnt -gt 1 ] ; then
    echo "Warning, you are already logged in.  Duplicate logins not allowed"
    echo "$USER attempted and extra login `date`" | mailx -s 'user login warning' \
           somebody@someplace.com
    exit
fi
   filename=/path/to/user/logs/${USER}.$(date +%Y%m%m-%H%M%S).log
   script $filename
   echo 'logout at $(date +%Y%m%m-%H%M%S)" >> $filename
exit

The file is your audit. These files will need maintenance or the disk will fill up over time

The other alternative is to turn on auditing. To help you with that we need to know the exact type of UNIX you have.
# 3  
Old 05-01-2013
thanks

Quote:
Originally Posted by jim mcnamara
The file is your audit. These files will need maintenance or the disk will fill up over time

The other alternative is to turn on auditing. To help you with that we need to know the exact type of UNIX you have.
Sir I'm using ubuntu 12.10. please help me in understanding how exactly i should report multiple logins to a script..
# 4  
Old 05-01-2013
Have you tried google? because my search for "ubuntu auditing" returned this:
How to keep a detailed audit trail of what’s being done on your Linux systems
# 5  
Old 05-01-2013
Users should be allowed to login only once

Why do you want to restrict that? Is it users setting off a whole bunch of processes in different windows?

You can use w command in a script to see how many logins, something like logins=`w | grep username | wc -l`
# 6  
Old 06-08-2013
Okay multiple log and all I'm done. Now all I need is to report if a particular user starts more than 5 processes in 5mins.
And if a user runs one particular process for more than 5 mins..
# 7  
Old 06-09-2013
First of all, who and users do less than w, so for only counting the user's logins I propose
Code:
logins=`users | grep -wc "${LOGNAME:-$USER}"`

(2nd attempt with $USER in case $LOGNAME is not set.)
--
For your processes requirement, check if you can use the information from
Code:
LC_ALL=C ps -u "${LOGNAME:-$USER}" -o pid,stime,etime,time

Hint: stime is neither well parse-able nor portable; etime is often better.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Monitoring tools

The monitoring tools what we have not able to see historical information about the process name or pid number for the process that consumed high CPU or memory or paging space. Can you please suggest some of the best monitoring tools available in the market that monitors primarily AIX and other Unix... (0 Replies)
Discussion started by: baladelaware73
0 Replies

2. Infrastructure Monitoring

Monitoring tools that do NOT require root privileges

Hi guys, I am currently managing an application running on around 150 servers. I only have application usage rights on those servers and do not have any root privileges. I have an external node that can connect to those servers and I have root privileges on that one box. I want to setup... (2 Replies)
Discussion started by: Junaid Subhani
2 Replies

3. Solaris

How can i monitor solaris server by using any monitoring tools

Hi forum We have nearly 240 servers inclding zones . How can i monitor server and its performance by using any monitoring tools. My indentions is to plot graphs based on server utilization interms of cpu and memory Is there any opensource tools for this. I saw collectd and it has agent... (3 Replies)
Discussion started by: bentech4u
3 Replies

4. Infrastructure Monitoring

Monitoring tools

I am interested whitch tools are the best by monitoring the UNIX processes and network interfaces ? and whitch tools for management UNIX ? I know that the nagios very good monitoring tools, but interested me and others who have ? (4 Replies)
Discussion started by: danyy
4 Replies

5. Infrastructure Monitoring

AIX monitoring tools for graphical output

Hi , I am new for Aix i am using IBM AIX server in our org. I am using tomcat and JDK 1.6 for our own ERP software the data base was stored in another server (windows ) i want to monitor my AIX server with graphical output from another system it is possible please help me, any other... (7 Replies)
Discussion started by: krishna_vnr`
7 Replies

6. Infrastructure Monitoring

Solaris Performance Monitoring Tools????

Hi, Are there any GUI (preferably web based) Solaris monitoring tools available for the SPARC platform. Just to clarify, when i say GUI, I don't mean buttons to configure the Software, of course that would be a plus, but rather GUI in terms of output, like Graphs. Thanks (6 Replies)
Discussion started by: Mack1982
6 Replies

7. Red Hat

Monitoring tools

Hi, In HPUX there is a grate monitor tools named GLANCE, which give you information on the disks load, memory usage, cpu ... What is the equivalent tool in LINUX Redhat 4. Thanks (3 Replies)
Discussion started by: yoavbe
3 Replies

8. UNIX for Advanced & Expert Users

UNIX monitoring tools

Guys, I would like to know who are using monitoring tools? I use Nagios before but it seems is more on Linux and Windows platform. - Nagios - BigBrother - BigSister - Cacti - MRTG - JFFNMS - anymore? Please give comment too I would like to have some comment on UNIX monitoring tools.... (2 Replies)
Discussion started by: dwarf007
2 Replies

9. Infrastructure Monitoring

UNIX Monitoring tools

I need some monitoring tools for SCO 7.1.4 Does anybody reccomend some software that I can install to monitor mem leaks and odd SAR values etc (2 Replies)
Discussion started by: trebor1
2 Replies

10. IP Networking

Networking Monitoring Tools

Any idea where can I get a freware to monitor the network traffic in my department? The best is this tool can store the log files. Thanks! (5 Replies)
Discussion started by: zheng_soon
5 Replies
Login or Register to Ask a Question