1833568 Members
3619 Online
110061 Solutions
New Discussion

stats with glance

 
Lorenzo Facello
Valued Contributor

stats with glance

Hi all,
I need to collect stats with glance every 30 sec ( always )
I tried to launch it with nohup:
nohup glance -j 30 -adviser_only -syntax /opt/perf/examples/adviser/activity" > /logs/test &
but if I close the shell it stop!!!
any suggestions??!!
thanks
LF
8 REPLIES 8
Sanjay Kumar Suri
Honored Contributor

Re: stats with glance

Use the cron to get the work done every 30 seconds.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Lorenzo Facello
Valued Contributor

Re: stats with glance

...
Can I use crontab every 30 sec????
Can you tell me the syntax, please?
L
Sanjay Kumar Suri
Honored Contributor

Re: stats with glance

Sorry Sir

cron's granularity is in minutes.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
RAC_1
Honored Contributor

Re: stats with glance

First thing is option -j. It is screen refresh interval for glance. Check man page for glance.

Also you can put any task in cron that is to be run periodically and is to be run for less than 1 min.

What you can do is put your glance command in script and put sleep statement so as to run it for every 30 secs. Like follows.
#!/usr/bin/ksh
while true
do
nohup glance -j 30 -adviser_only -syntax /opt/perf/examples/adviser/activity" > /logs/test
sleep 30
done

Also your redirection for command should be >> instead of >. > will overwrite the file everytime the command is run.

Anil
There is no substitute to HARDWORK
Johan Lorimier
Frequent Advisor

Re: stats with glance

HI,

what type of stats are you interrested in ?

If it is only the simple ones as cpu, io, pagination you can use sar that will do the job very well.

To do it with sar add the following line to the root crontab :

0 * * * * /usr/lbin/sa/sa1 600 6

be sure that the directory /var/adm/sa exist.

Johan
RAC_1
Honored Contributor

Re: stats with glance

Typo in my reply. Read as follows.

Also you can not put any task in cron that is to be run periodically and is to be run for less than 1 min.
There is no substitute to HARDWORK
Sanjay Kumar Suri
Honored Contributor

Re: stats with glance

Can at command be used for this purpose as in at seconds can be sepcified?

while true
do
at command
sleep 30
done

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
David Nardi
Advisor

Re: stats with glance

Do you want it to continually run and update every 30 seconds, or run every 30 seconds but stop after reporting the stats? You can use the -iterations option to distinguish.

You can use cron or the at command to run it every minute with -a 30 second interval (-j 30) for 2 intervals (-interval 2).

The command would look like this:
glance -j 30 -iterations 2 -adviser_only -syntax /opt/perf/examples/adviser/activity >> temp

Also, look into using the -bootup option for glance.