How to get default log details of lotusscript agent - lotus-notes

I developed an notes application called "agent monitoring" which will trigger email daily when the schedule agent prints an error in the log.nsf file.
2017-03-28 09:39:42 AMgr: Agent ('GoSAP' in '\DomApps\GoSAP.nsf') error message: MQJE001: Completion Code '2', Reason '2033'.
I search for details using an "error message" regular expression string in the log and then send email.
Now I would like to handle when the agent hangs. I think it can be done if we get details from the default agent log as shown here.
Can somebody please guide me on how to achieve this?

[EDIT]==> look at #Richard Schwartz response, it seems possible with NotesDXLExporter.
[Original response]
This is not possible programmatically in Notes.
Remark: if you have a client running, you can use sendkey (windows dll not the notes function that is buggy) to display the log.
This question has also been asked years ago in experts-exchange
also without solution there.

The agent log can be accessed this way.
For eaach database that you are interested in, set up a NotesNoteCollection with SelectAgents=true and call BuildCollection.
Iterate through the collection with getFirstNoteId/getNextNoteId and get the agent notes via GetDocumentByID
Use NotesDXLExporter with the agent note as input to generate XML, then parse the XML and read the <trigger type> and/or <agent name> data to determine if you care about the agent. If it's a scheduled agent that you want to monitor, then look at the <runlog> data.

Related

WebHook Tags for OMS

I have a Webhook setup in the OMS(Microsoft Operation Management Suite). I want some Tags(e.g. #alertrulename,#searchinterval etc).
I have googled & got 6-7 tags which are helpful to trigger the OMS alert specific details. Is there any tag which can send the Log details of the query?
i.e. the Queered Log.
Reference--> MSN
These are all the actions available to the webhook:
AlertRuleName
AlertThresholdOperator
AlertThresholdValue
LinkToSearchResults
ResultCount
SearchIntervalEndtimeUtc
SearchIntervalInSeconds
SearchIntervalStartTimeUtc
SearchQuery
SearchResults
WorkspaceID
Also, if your workspace is upgraded take a look here.
These all webhook variables need to be in certain format.
{"AlertName":"#alertrulename", "IncludeSearchResults":true}
Don't use any Sub-node (child node) i.e.
{"Data": {"AlertName":"#alertrulename", "IncludeSearchResults":true }}
NB:- Don't click on TestWebhook, it won't return any Logs, wit for the Timely trigger according to the schedule you have given to fire.

Debugging Groovy in Jira Scriptrunner inline editor

I'm a programmer who is just getting started working with groovy in Jira in order to automate some tasks.
I'm trying to write a custom listener script using the inline editor in Jira, but haven't gotten past trying to get a Hello World program to work.
I don't know if the script is running, and can't see any output, and I really need some help with figuring out how to debug the script, preferably through outputs to some kind of console (or even just by reading the Jira logs if necessary), just so that I can actually start trying to learn how to use this tool.
I'm working with the information HERE as a general guideline to start learning to work with the inline editor.
For a little more context, you can see another related question that I asked HERE.
I've set the debug level to DEBUG for the event which I'm attaching the listener, as shown in this screenshot, based on the information found HERE:
Here is a screenshot of the inline editor I'm working in in JIRA. In this screenshot, I'm just trying to output 'Hello', and have just clicked the 'Preview' button:
As you can see, in the 'Result' tab at the bottom of the screen, there is nothing of interest. The 'Logs' tab is also empty, and the 'Timing' tab just says 'Elapsed: 0 ms CPU time: 0 ms', so it seems like nothing if happening.
If I check the log on the server (in the file catalina.2017-10-13.txt), I see the following output:
13-Oct-2017 07:01:50.942 WARNING [http-nio-8080-exec-6] com.sun.jersey.spi.container.servlet.WebComponent.filterFormParameters A servlet request, to the URI http://somevmserver:8080/rest/scriptrunner-jira/latest/listeners/com.onresolve.scriptrunner.canned.jira.workflow.listeners.CustomListener/params, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using #FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
13-Oct-2017 07:02:26.740 WARNING [http-nio-8080-exec-12] com.sun.jersey.spi.container.servlet.WebComponent.filterFormParameters A servlet request, to the URI http://somevmserver:8080/rest/scriptrunner/latest/canned/com.onresolve.scriptrunner.canned.common.StaticCompilationChecker, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using #FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
13-Oct-2017 07:02:26.974 WARNING [http-nio-8080-exec-1] com.sun.jersey.spi.container.servlet.WebComponent.filterFormParameters A servlet request, to the URI http://somevmserver:8080/rest/scriptrunner-jira/latest/listeners/com.onresolve.scriptrunner.canned.jira.workflow.listeners.CustomListener/preview, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using #FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
This output doesn't mean a whole lot to me, but it seems apparent that it's being populated as a result of trying to preview the script.
I'm not getting any errors in the inline editor, and it's really simple code, so I don't think it's that.
The only other information I can include that I think is pertinent is that this is a test instance of Jira cloned from our production environment, and its base URL is still set to the URL of the prod environment. Not sure if that has any bearing, but I'm not really a Jira admin, just the programmer tasked with doing this, so I don't want to go fiddling around where I don't need to.
Thanks!
When using scriptrunner within jira, you'll need to import the logger to use the debugger or to output to the console. This can be done with the following:
// Enable debugger
import org.apache.log4j.Logger
import org.apache.log4j.Level
def log = Logger.getLogger("com.acme.CreateSubtask")
log.setLevel(Level.DEBUG)
And then, you'll be able to see the logged information using log.debug "hello"
To see your debug message "Hello" in the log, you must update a issue in your selected project. The Result, Logs and Timing Tabs at the bottom are useless in this view. Just trigger the Listener with a issue update in your selected project and search your debug message in the atlassian-jira.log file.
Hint: To view the Log in the browser you can use this jira app https://marketplace.atlassian.com/plugins/com.cps.lastLog/server/overview

Progressive Web Application receiving data to trigger notification

Hello i'm newbie and im hardly to understand this notification in service-worker, and because my knowledge isn't good yet then probably i will unable to explain my problem clearly.
so here's the code :
// triggered everytime, when a push notification is received.
self.addEventListener('push', function(event) {
console.info('Event: Push');
var title = 'New commit on Github Repo: RIL';
var body = {
'body': 'Click to see the latest commit',
'tag': 'pwa',
'icon': './images/48x48.png'
};
event.waitUntil(
self.registration.showNotification(title, body)
);
});
this is the code that trigger to POP the notification, what I do not understand is where the argument to accept/ receive the data ?
I've been searched a lot: https://auth0.com/blog/introduction-to-progressive-web-apps-push-notifications-part-3/ ,
https://developers.google.com/web/updates/2015/03/push-notifications-on-the-open-web
there's some new data JSON or from git-server or push api, but I still hardly to understand where's to accept the data.
sorry if you still do not understand what's my problem.
Here to make it simple what I want :
Let's say i make a button, and everytime i click the button it will value as 'True' and I want that 'True' value to pass into argument and trigger the push of notication in service-worker.
2nd questions: am I able to trigger notification with header or text in html ? since we can manipulate the text with DOM ?
am I able to trigger notification without GCM, or API cause I just want a simple notification in serivce-worker like above without passing much data.
If you give more advice or maybe notification without service-worker but real time , I am surely happy to read it but I hope Im able to understand.
There are basically two concepts involved that work well together but can be used independently. The first is the visible UI shown to a user that tells them information or prompts them for an action. The second is sending an event from a server to the browser without requiring the user to currently be active on the site. For full details I recommend reading Google's Web Push docs.
Before either of those scenarios you have to request permission from the user. Once permission is granted you can just create a notification. No server or service worker required.
If you want to send events from a server you will need a service worker and you will need to get a subscription for the user. Once you have a subscription you would send it to a server for when you want to send an event to that specific browser instance.
Once you receive a push event from a server you display the UI the same as in the first scenario except you have to do it from the service worker.

SuiteScript Error when trying to create a new inventory detail subrecord on Work Order Issue

My client side suitescript has following line of code:
compSubRec = nlapiCreateCurrentLineItemSubrecord('component', 'componentinventorydetail');
For some reason, this results in an error below:
INVALID_RCRD_INITIALIZE
You have entered an invalid default value for this record initialize operation.
What might this be?
As far as I know, subrecords are not available in Client Side scripts. There are only available on Server Side script, e.g. User Event, Scheduled.
As the Document says :
nlapiCreateCurrentLineItemSubrecord(sublist, fldname)
This API should only be used in user event scripts on the parent record. Note, however, this API is not supported in beforeLoad user event scripts. This API is also not currently supported in form-level or record-level client SuiteScripts associated with the parent record.
Make sure your script has to be an userevent not a client script.

Mailer Error PHP

i have created a PHP feedback form for my website. but it got error when i click the button submit. It said that "Could not instantiate mail function. Mailer Error: Could not instantiate mail function.". I have tried many time for solving this problem.
My server is Windows server which is i am using PARALLEL HELM.
My Website link with feedback form is http://vivalife.com.my/home/index.php/contact-us/feedback-form/
I hope that anyone can solve my problem.
Thank you
I suppose phpmailer is an external class... And it's trying to use the PHP mail function. First of all check that your server has mail() function enabled.
To do so, I recommend doing something like this, on a php test file:
if (!mail(......)){
// show error for debugging.
}
If Mail Function - PHP is enabled, you should check the SMTP configuration on your php.ini file...
Let us know.

Resources