Operating System - HP-UX
1825756 Members
2355 Online
109687 Solutions
New Discussion

Galance: stdin is not a terminal device

 
SOLVED
Go to solution
Chris Frangandonis
Regular Advisor

Galance: stdin is not a terminal device

Hi All,

I am trying to run glance using the crontab but get the following mesg

===================== GlancePlus Fatal Error =====================
Version:
User : tracker Date: Wed Apr 4 15:08:00
File : ../../../gp/source/glance/terminal.c Line: 159
System : tcenh197 B.11.11 9000/800

Unable to initialize terminal.
stdin is not a terminal device.
======================================================================


===================== GlancePlus Non-Fatal Error =====================
Version:
User : tracker Date: Wed Apr 4 15:08:01
File : ../../../gp/source/glance/glance.c Line: 1377
System : tcenh197 B.11.11 9000/800

Unable to perform functions on devices.
======================================================================


===================== GlancePlus Non-Fatal Error =====================
Version:
User : tracker Date: Wed Apr 4 15:08:01
File : ../../../gp/source/glance/glance.c Line: 1379
System : tcenh197 B.11.11 9000/800

Unable to perform functions on devices.
======================================================================

Script
======
#!/usr/bin/ksh

. $HOME/.profile

Home=/tmp/mem.txt
/opt/perf/bin/glance -j 1 -iterations 1 -m -f $Home 2>/dev/null

Crontab
========
31 * * * * sh -xv /tracker/palmTracker/scripts/mem_check.sh > /tracker/Chris.log

When running from command line then no problem. What am I missing???


Many Thanks
Chris
10 REPLIES 10
James R. Ferguson
Acclaimed Contributor

Re: Galance: stdin is not a terminal device

Chris:

There is no terminal (STDIN) associated with any 'cron' task.

You can run 'glance' with the '-adviser_only' switch which will suppress terminal display and allow yuo to create a crontask. Redirect STDOUT to a file to capture data.

Regards!

...JRF...
Chris Frangandonis
Regular Advisor

Re: Galance: stdin is not a terminal device

Hi JRF,

Thanks, so what you are saying use the glance cmd as follows

/opt/perf/bin/glance -adviser_only -j 1 -iterations 1 -m -f $Home 2>/dev/null

Is this correct?


Thanks
Chris




James R. Ferguson
Acclaimed Contributor

Re: Galance: stdin is not a terminal device

Hi (again) Chris:

Ooops, this ins't going to work as expected. It pays to try things.

NO POINTS please.

Regards!

...JRF...
Chris Frangandonis
Regular Advisor

Re: Galance: stdin is not a terminal device

Hi JRF,

So no go with -adviser_only. Any other options for this??
Thanks
Chris
James R. Ferguson
Acclaimed Contributor

Re: Galance: stdin is not a terminal device

Hi Chris:

Perhaps you may derive some useful help from this documentation:

http://ovweb.external.hp.com/ovnsmdps/pdf/adviser_lx.pdf

You can may not be able to 'cron' the task but you can collect data into a file, but then you already know that :-)

Regards!

...JRF...
Dave La Mar
Honored Contributor
Solution

Re: Galance: stdin is not a terminal device

Chris -
This is one we run from cron daily -

/opt/perf/bin/glance -adviser_only -syntax $SYNTAX_FILE -j 5 -iterations 2
The syntax file is for monitoring memory, the the metrics used.

PRINT " #####################################################"
PRINT " Date In Time: ",gbl_statdate
PRINT " Point in Time ",gbl_stattime
PRINT " System Memory: ",gbl_mem_sys
PRINT " Buffer Cache: ",gbl_mem_cache
PRINT " User Memory: ",gbl_mem_user
PRINT " Free Memory: ",gbl_mem_free
PRINT " _____________________________________________________"
PRINT " Total Physical Memory: ",gbl_mem_phys
PRINT ""
PRINT " CPU Normal Utilization: ",gbl_cpu_normal_util
PRINT " CPU Nice Utilization: ",gbl_cpu_nice_util
PRINT " CPU Realtime Utilization:",gbl_cpu_realtime_util
PRINT " CPU Sysmode Utilization: ",gbl_cpu_sys_mode_util
PRINT " _____________________________________________________"
PRINT " CPU Total Utilization: ",gbl_cpu_total_util
PRINT ""
PRINT " PAGE OUT RATE: ",gbl_mem_pageout_rate
PRINT " ====================================================="
PRINT ""

Best of luck on this.

Regards,

-dl
"I'm not dumb. I just have a command of thoroughly useless information."
Chris Frangandonis
Regular Advisor

Re: Galance: stdin is not a terminal device

Hi Dave,

Thanks. I dont know if I am right but should I print the "PRINT" into a file and then define it for e.g.

#The syntax file is for monitoring memory, the the metrics used.

print " #####################################################" > SYNTAX_FILE
print " Date In Time: ",gbl_statdate >> SYNTAX_FILE
print " Point in Time ",gbl_stattime >> SYNTAX_FILE
print " System Memory: ",gbl_mem_sys >> SYNTAX_FILE
print " Buffer Cache: ",gbl_mem_cache >> SYNTAX_FILE
print " User Memory: ",gbl_mem_user >> SYNTAX_FILE
print " Free Memory: ",gbl_mem_free >> SYNTAX_FILE
print " _____________________________________________________" >> SYNTAX_FILE
print " Total Physical Memory: ",gbl_mem_phys >> SYNTAX_FILE
print "" >> SYNTAX_FILE
print " CPU Normal Utilization: ",gbl_cpu_normal_util >> SYNTAX_FILE
print " CPU Nice Utilization: ",gbl_cpu_nice_util >> SYNTAX_FILE
print " CPU Realtime Utilization:",gbl_cpu_realtime_util >> SYNTAX_FILE
print " CPU Sysmode Utilization: ",gbl_cpu_sys_mode_util >> SYNTAX_FILE
print " _____________________________________________________" >> SYNTAX_FILE
print " CPU Total Utilization: ",gbl_cpu_total_util >> SYNTAX_FILE
print "" >> SYNTAX_FILE
print " PAGE OUT RATE: ",gbl_mem_pageout_rate >> SYNTAX_FILE
print " =====================================================" >> SYNTAX_FILE
print "" >> SYNTAX_FILE

SYNTAX_FILE=`cat SYNTAX_FILE`

/opt/perf/bin/glance -adviser_only -syntax $SYNTAX_FILE -j 1 -iterations 1


Thanks Again
Chris
James R. Ferguson
Acclaimed Contributor

Re: Galance: stdin is not a terminal device

Hi Chris:

Dave meant for you to create a ${SYNTAX_FILE} exactly as he wrote it, not as you ammended it.

His technique *does* work. You might want to redirect STDERR to /dev/null to eliminate the messages that you originally posted in opening this thread. THis will eliminate superflous mail when you 'cron' the task.

Define your SYNTAX_FILE and your GLANCE_OUTPUT variables and do:

# glance -adviser_only -syntax ${SYNTAX_FILE} -j 5 -iterations 2 > ${GLANCE_OUTPUT} 2 >/dev/null

The man pages for 'glance' offers some useful notes, too.

Regards!

...JRF...
Dave La Mar
Honored Contributor

Re: Galance: stdin is not a terminal device

Chris -
James is correct. The sample syntax file content is used as posted.
/opt/perf/examples/adviser will give you examples.
The metrics you use in your syntax file is according to your needs.
I left out the actual redirection that James mentioned. My actual collection command is as follows -
/opt/perf/bin/glance -adviser_only -syntax $SYNTAX_FILE -j 5 -iterations 2 2>/dev/null >> SOME_LOG_FILE

Your metrics can be found in /opt/perf/paperdocs/mwa/C.
This is a great tool for guaging performance and for capacity planning.

Happy hunting.
Regards,

-dl
"I'm not dumb. I just have a command of thoroughly useless information."
Dave La Mar
Honored Contributor

Re: Galance: stdin is not a terminal device

Chris -
Sorry, I also forgot to mention that the sample I provided, we actually run in while loop, gathering samplings every 5 seconds. We have the while loop set to run from start to 5 p.m. daily. Of course you want to single redirect to the log file upon the first execution to initialze the log file daily.
Hope this explains the iterations of 2, wouldn't make much sense to take only two samplings and get out.

:)

-dl
"I'm not dumb. I just have a command of thoroughly useless information."