[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference csc32::consolemanager

Title:POLYCENTER Console Manager
Notice:Kits, Scans, Docs on CSC32:: as PCM$KITS:,PCM$DOCS:, PCM$SCANS:
Moderator:CSC32::BUTTERWORTH
Created:Thu Aug 06 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1541
Total number of notes:6564

87.0. "How to get TEXT to action routine" by EEMELI::OJUSSILA (Olli Jussila, IS/SMGT Finland) Mon Aug 09 1993 19:16

    
    
    	I am trying to create CM action c-shell script which
    	needs the text of the event as a parameter. 
    	The text for the event has been defined with literal attribute.
    	But the paramater for the text $n is all was null string?
    	Why CM is not passing the text to action routine?
    
    	I also noticed that the for the action examples there is
    	no text defined. It is possible to pass the text to action
    	routine?
    
    	-Olli
    
T.RTitleUserPersonal
Name
DateLines
87.1OPG::PHILIPAnd through the square window...Tue Aug 10 1993 11:5013
Olli,

  Can you post your action definition, it would help me to understand
  your problem (just export the database and cut out the ADD_ACTION
  part for your action).

  It is possible that your action does not get the text (that is the
  actual line of context, not the text as defined in the event record)
  because the daemon has not flushed out the text to disk quickly
  enough for the ens daemon to read it from the log file.

Cheers,
Phil
87.2It works every now and thenEEMELI::OJUSSILAOlli Jussila, IS/SMGT FinlandTue Aug 10 1993 15:5311
    
    
    My event text is "DCM ALL:"
    After more testing  I noticed that if the event line is longer
    the text line is passed to action routine. Some times text is only
    partially passed to action routine. Probably your explanation
    explains this. Is there any way to make deamon to flaush text to disk
    quicker? This is very critical for us.
    
    	-Olli                         
    
87.3OPG::PHILIPAnd through the square window...Tue Aug 10 1993 16:458
  Changing the event text to regular expression and adding *^ to the end
  of the text may help, this will cause the event to only be detected
  after the following newline, so, the whole of the line should have been
  flushed to disk by the time the action routine/ens has got it.

Cheers,
Phil
87.4sh or csh and " or 'EEMELI::OJUSSILAOlli Jussila, IS/SMGT FinlandTue Aug 10 1993 18:4721
    
    Regular expression seems to help. But I also had for testing
    reasons context start 1 and context count 2. I changed start to
    0 and count to 1. Then I was able to get TEXT to action routine
    BUT csh script didn't work.
    It seems that there is a problem using csh instead of sh.
    After I changed to sh from csh script works.  Should we
    used sh only?
    
    Other problem is to pass event text containing $ to action script
    I am sending PSW event to opa0: like
    
    PSW ALL:~NEW~EXT~NODE1~10-AUG NODE1 Disk NODE1$DKA200 is near full...
    
    Now $DKA200 string doesn't get to script. 
    
    It seems that CM is using "-around the text string. If '-is used
    then script will get the whole string. 
    
    -Olli
    
87.5OPG::PHILIPAnd through the square window...Wed Aug 11 1993 09:4834
Olli,

>>    Regular expression seems to help. But I also had for testing
>>    reasons context start 1 and context count 2. I changed start to
>>    0 and count to 1. Then I was able to get TEXT to action routine
>>    BUT csh script didn't work.
>>    It seems that there is a problem using csh instead of sh.
>>    After I changed to sh from csh script works.  Should we
>>    used sh only?

  We simply perform a system() call to invoke the action routines, so it will
  probably default to sh as that is normally the default for root (the account
  cm is started up in), you could try changing root to use csh in /etc/passwd,
  although I dont know what the impact of this will be on the rest of the
  system, however, it should work with csh if you put the #! /bin/csh at the
  start of the procedure (If it isnt, I dont know why).

>>    Other problem is to pass event text containing $ to action script
>>    I am sending PSW event to opa0: like
>>    
>>    PSW ALL:~NEW~EXT~NODE1~10-AUG NODE1 Disk NODE1$DKA200 is near full...
>>    
>>    Now $DKA200 string doesn't get to script. 
>>    
>>    It seems that CM is using "-around the text string. If '-is used
>>    then script will get the whole string.

  For the next release, on ULTRIX (does this apply to OSF too?), I will change
  the quoting to use a ' instead of the ", what I think it is doing here is a
  substitute for the symbol $DKA200, which of course doesnt exist, so sh is
  replacing it will a blank.

Cheers,
Phil
87.6More testing done. /bin/sh only worksEEMELI::OJUSSILAOlli Jussila, IS/SMGT FinlandWed Aug 11 1993 18:2222
    
    
    I have #! /bin/csh or #! /bin/sh at start of the script.
    The test command was simple 
    
    /bin/echo "***$1***$2***$3**" >> /var/cm/logs/test.log
    
    When sh was used script work but not with csh
    
    cm -d incicated action counter was increased when test event was sent
    to one console line.
    
    Maybe someone else could try this also.
    
    Is there some log file/error file some where I could check?
    
    -Olli
    
    
    
    
    
87.7EEMELI::OJUSSILAOlli Jussila, IS/SMGT FinlandThu Aug 12 1993 18:099
    
    re .5
    
>  For the next release, on ULTRIX (does this apply to OSF too?), I will change
>  the quoting to use a ' instead of the ", 
    
    It does apply to OSF too.
    
    -Olli
87.8It has been changed for OSF and ULTRIX for V1.1OPG::PHILIPAnd through the square window...Mon Aug 16 1993 15:070