Server Management - Systems Insight Manager
1833838 Members
2345 Online
110063 Solutions
New Discussion

Custom Command execution Problem

 
Rob Buxton
Honored Contributor

Custom Command execution Problem

I'm having trouble getting a custom command to work. I use perl to reformat messages to pass to our Remedy System. This works on IM 7 using the application launch feature but I cannot replicate the job under HPSIM.

The Custom Command has:
Command = d:\perl\bin\perl
Parameters = d:\Perl_Scripts\IM_Major_Event.pl

This script should open a file, write the contents of the $NOTICEPLAINTEXT to it, close it and then use blat to e-mail it.

I generate a generic trap and the event appears in HPSIM, a simple e-mail task works. The custom task has fired according to the task schedule but I get no e-mail.
From the mx.log file I can see:
NZDT,CONFIG,SUCCESS,START,TASK,44012_aegis.wcc.govt.nz,SUMMARY,wcc\buxton2r,0,158728,Rob Buxton
@!@,2004-01-29 10:36:09 NZDT,JOB,PROGRESS,START,JOB,44012_aegis.wcc.govt.nz,VERBOSE,wcc\buxton2r,,,
Running Tool:IM_perl_Major_event
Expanded Command Line:d:\perl\bin\perl d:\Perl_Scripts\IM_Major_Event.pl
Targets:
aegis.wcc.govt.nz
Run As User UID:wcc\buxton2r

@!@,2004-01-29 10:36:09 NZDT,CONFIG,SUCCESS,MODIFY,TASK,Ping Hardware Status Polling,SUMMARY,wcc\buxton2r,0,158729,Rob Buxton
@!@,2004-01-29 10:36:09 NZDT,CONFIG,SUCCESS,START,TASK,44013_aegis.wcc.govt.nz,SUMMARY,wcc\buxton2r,0,158729,Rob Buxton
@!@,2004-01-29 10:36:09 NZDT,JOB,PROGRESS,START,JOB,44012_aegis.wcc.govt.nz:aegis.wcc.govt.nz,DETAIL,wcc\buxton2r,,,
Running Tool:IM_perl_Major_event

@!@,2004-01-29 10:36:09 NZDT,JOB,FAILURE,DONE,JOB,44012_aegis.wcc.govt.nz:aegis.wcc.govt.nz,ERROR,wcc\buxton2r,,,
Running Tool:IM_perl_Major_event

Any help or hints appreciated.

6 REPLIES 6
David Claypool
Honored Contributor

Re: Custom Command execution Problem

Rob:

Maybe you can attach as a file...the formatting is getting confused.

I'm not sure from what you're reporting what portion you suspect it is failing at, firing the task, sucessfully loading Perl and the script or executing the email.

If you echo some log info into a file at the beginning of the perl script, does it show up?
Rob Buxton
Honored Contributor

Re: Custom Command execution Problem

David,
The task is failing somewhere in the triggering of the custom command if that makes sense.
HPSIM reports it as having successfully completed.

I'm not deleting the temporary file in the perl script so I should be able to find that. Alas, I can't which leads me to suspect the perl script itself wasn't run.

The only evidence I can find is in the mx.log file for HPSIM.
There is now just a single entry:

NZDT,CONFIG,SUCCESS,START,TASK,44119_aegis.wcc.govt.nz,SUMMARY,WCC\WCCAdmin,0,159160,
@!@,2004-01-29 11:53:29 NZDT,CONFIG,SUCCESS,MODIFY,TASK,IM Major Event - perl test,SUMMARY,WCC\WCCAdmin,0,159160,

Following another thread here on SSH, I hadn't set that up as to include me. And the task was running in my name, so I changed that to use the account HPSIM was set up in (wccadmin listed above).
I think the errors in the earlier log file may have been from not having myself in the SSH set up?

So, the command is being fired, but I just cannot find evidence it has done anything. If I run the perl script manually it works.

As I said earlier, I've done this using CIM 7, but just can't track where this is dying.
Rob Buxton
Honored Contributor

Re: Custom Command execution Problem

David,

Looks as though it's the SSH securrity. I have done some initial testing and it is now firing.

I guess I now need to understand a bit more of what is required in order to set up SSH in order to get this to work for all users, or we just use the admin account that HPSIM was originally installed in.
David Claypool
Honored Contributor

Re: Custom Command execution Problem

Rob:

If what I emailed you does the trick, post it here so others can benefit...
Rob Buxton
Honored Contributor

Re: Custom Command execution Problem

This is just a quick follow. This is still proving troublesome and David has been offering some advice and guidance offline from the forum.
Once I've got an established pattern of cause and efect I'll post here as I believe the issues I'm encountering could well effect others.
Rob Buxton
Honored Contributor

Re: Custom Command execution Problem

This is now working but it only happened after a reinstall of OpenSSH.

And, if like me, you typically use HPSIM under an account other than the account it was installed under, ensure that account is added into OpenSSH's passwd file.

I've no idea what got broken with OpenSSH, but I do know that it's difficult to trace, there's just a gap between the Event Notification saying it has run the Custom Command and nothing coming out of the Custom Command.

It looks as though simple e-mail etc. are run within the CMS Server, but Custom Commands are sent out and back in and run via OpenSSH.