Periodical status messages by Jopr? - email

I'm evaluating Jopr 2.3.1 to monitor a JBoss 4.2.3 Application Server.
Jopr, based on the better known RHQ Project from Redhat, supports to send email notifications triggered by so called alerts. Alerts can be defined to react to certain changes of system parameter such as metrics (e.g. 'Active Thread Count', 'JVM Free Memory') or the availability (e.g. goes UP, goes DOWN) changes.
I'm now wondering if it's also possible to send a for instance weekly status report by email?
Just to make sure: This email notification is to be send periodically, indipendent of the regular alter notification, rather problems occured or not.
Many thanks in advance - every hint is appreciated
Tobias

RHQ 3 (anything Jopr related is old and outdated) has server side plugins.
They can be alert notification senders that let you e.g. connect to a trouble ticket system for alert notifications.
They can also be more generic and can be triggered periodically via an "internal cron". The latter may be what you want for report sending. In fact, Mazz has already written an example plugin generating a report on file system - you would only need to change the "write to disk" to "send email".
http://rhq-project.org/

Related

Processing e-mail in Odoo 11 without previous threads – is this possible?

This Odoo company we're working with basically sends a lot of e-mail. One e-mail thread can turn into 100+ e-mails with different people brought into the conversation (CC'd) at different times. Due to the complexity of their e-mail management, they want to use their Gmail interface (Google Hosted) and CC an e-mail into odoo and they want it to get tracked in a thread. I've basically already done that... they have an e-mail like odoo+res.partner-432#domain.com (although it's hashed to not be easily readable) - they CC this and the full body thread gets included in chatter (mail.message) under respective model / id.
The challenge with this: the chatter messages can get huge very fast, due to their e-mail messages (because each e-mail includes main reply, and all previous history on thread). I've looked into some systems that have a "reply above this line" - and it just takes the latest message. And in those systems, eg. ticketing systems such as Zendesk, help scout, I believe the teams are using the ticketing system (not a gmail) and thus there is much more control over the inbox and incoming email (not to mention, those e-mails are usually 1-to-1, not including groups).
My questions:
Is there any other workaround that you see here to have odoo pull in only the last e-mail reply and not the full e-mail thread? I could probably build something like this: https://github.com/zapier/email-reply-parser - and hook it into odoos e-mail parsing, but that works on text format e-mails only (not HTML)... only. So it's not bulletproof, and I'm not sure it's worth it.
Even if this client DID use odoo 100%, I still don't think it would be possible to get it to work the way they want without major customizations (eg. Odoo's default behavior is to include all past e-mail threads)
I'm curious if anyone here see's any other solutions, otherwise – I doubt there is something here I haven't seen. :) (But very open to be proven incorrect!)

OpenPop and Web Beacons error with GetMessages

Has anyone working with OpenPop get errors when the emails being processed have web beacons in them? I have two services that process inboxs, extracting attachments, and creates blobs for processing, but whenever an email that has a web beacon (code to single back to the mothership) the openPop dies on GetMessages. If I forward the message right back to the same mailbox, the forward removes the web beacon and all is well.
We had to setup an OWA rule that detects messages, for example from quickbooks#notification.intuit.com and forwards them right back to the same inbox. This automatically cleans out the web beacon, but the sender is no longer known and we cannot notify them and let them know we received their invoice.
Not sure how to get rid of the web beacons, but retain the sender.
Any help appreciated.
Here is where it dies, and what the error is:
Errors I trap
1/3/2017 7:47 PM: ProcessAllMessages - GetAllMessages Exception - Length cannot be less than zero.
Parameter name: length
1/3/2017 7:47 PM: ProcessAllMessages - Retrieved 0 out of 1 email(s) successfully.
We had to move off of the OpenPop as it appears there were just some core issues handling certain mime types that came in by email. Since no one can control devices, email clients of email senders we needed a more robust solution that handled exceptions rather than quit at an exception.
We migrated/rewrote using exchange web services
https://msdn.microsoft.com/en-us/library/office/dn567668.aspx
it was pretty easy to migrate the code as we only had to change connections and a few basic objects. The majority of the framework we had written was not changed at all.

Azure WebJob Logging/Emailing

I've converted a console app into a scheduled WebJob. All is working well, but I'm having a little trouble figuring out how to accomplish the error logging/emailing I'd like to have.
1.) I am using Console.WriteLine and Console.Error.WriteLine to create log messages. I see these displayed in the portal when I go to WebJob Run Details. Is there any way to have these logs saved to files somewhere? I added my storage account connection string as AzureWebJobsDashboard and AzureWebJobsStorage. But this appears to have just created an "azure-webjobs-dashboard" blob container that only has a "version" file in it.
2.) Is there a way to get line numbers to show up for exceptions in the WebJob log?
3.) What is the best way to send emails from within the WebJob console app? For example, if a certain condition occurs, I may want to have it send me and/or someone else (depending on what the condition is) an email along with logging the condition using Console.WriteLine or Console.Error.WriteLine. I've seen info on triggering emails via a queue or triggering emails on job failure, but what is the best way to just send an email directly in your console app code when it's running as a WebJob?
How is your job being scheduled? It sounds like you're using the WebJobs SDK - are you using the TimerTrigger for scheduling (from the Extensions library)? That extensions library also contains a new SendGrid binding that you can use to send emails from your job functions. We plan on expanding on that to also facilitate failure notifications like you describe, but it's not there yet. Nothing stops you from building something yourself however, using the new JobHostConfiguration.Tracing.Trace to plug in your own TraceWriter that you can use to catch errors/warnings and act as you see fit. All of this is in the beta1 pre-release.
Using that approach of plugging in a custom TraceWriter, I've been thinking of writing one that allows you to specify an error threshold/sliding window, and if the error rate exceeds, an email or other notification will be sent. All the pieces are there for this, just haven't done it yet :)
Regarding logging, the job logs (including your Console.WriteLines) are actually written to disk in your Web App (details here). You should be able to see them if you browse your site log directory. However, if you're using the SDK and Dashboard, you can also use the TextWriter/TraceWriter bindings for logging. These logs will be written to your storage account and will show up in the Dashboard Functions page per invocation. Here's an example.
Logs to files: You can use a custom TraceWriter https://gist.github.com/aaronhoffman/3e319cf519eb8bf76c8f3e4fa6f1b4ae
Exception Stack Trace Line Numbers: You will need to make sure your project is built with debug info set to "full" (more info http://aaron-hoffman.blogspot.com/2016/07/get-line-numbers-in-exception-stack.html)
SendGrid, Amazon Simple Email Service (SES), etc.

How to hook 'send email' of IBM Lotus Notes

I'm working on a plugin for IBM Lotus Notes. I need to change content of an email right after user clicks 'send email' button, before the email is actually sent. I have searched APIs of Lotus Notes but can't find a workaround. There is a library named com.ibm.notes.mailsend in folder /opt/ibm/lotus/notes/framework/shared/eclipse/plugins. But I can't find any document related to it on Internet, and have no idea how to capture event about sending email. Does anyone know how to implement the function that I need? Thanks.
Update: Thanks Richard. Basically I've figured out how to hook email sending. But I also need to make an option that user can set differently for each individual email. From my understanding, email known as message is stored in Mail File database before being sent. How to 'add flag' to the message? Thanks.
The way to hook events in Lotus Notes is with the Notes C API's Extension Manager routines. The general strategy for hooking mail send operations is to set up a hook on EM_NSFNoteUpdateMailbox. This can be done on either the Notes client or the Domino Server. On the server side, if your processing is non-trivial, you run the risk of slowing down Domino if you try to do all of the work in your hook, so the strategy most people adopt is to have the hook code change the status of the message to "On Hold" and then signal a separate server task to take over the work. That way the hook can return and the separate server task can take whatever time is needed before resetting the status of the message so that normal routing will take over. You can find documentation here.
For server-side processing only, there are two options that will allow you to write your code in Java instead of C. One is an OpenNTF project called TriggerHappy that allows you to write Java Agents that are fired when some boilerplate hook code is triggered, and the other is the OpenNTF version of the Domino OSGi Tasklet Service (aka DOTS), which allows taskets to be fired in response to EM events. Note that there is an IBM-supported version of DOTS that is shipped in Domino 9 "Social Edition", but my understanding is that it does not include the EM event support.
Updated for additional info requested...
In order to add a flag to each message that can be read by the code that runs in your hook, you need to modify the mail template that is used in the users' mail files. You will need permission from the Domino system administrators to do this, and to be blunt: this is not something that Domino adminisrators like to do because it makes their job more difficult when they are upgrading Domino versions. There are many ways you could modify the template, but the point of all of them would be to add a new hidden field to messages which would serve as a flag for your hook code. If the field exists, your code would do the changes to the content that you need, otherwise it would leave the content alone. One possible way to do this would be by adding a shared action containing a formula to set your hidden field (that formula is just something like FIELD myFlagFieldName := "1";) and then you can add that shared action to the Memo form. Users would press the action button any time they want to trigger your code. The admin would need to maintain backup database containing your shared action and re-add it to the mail template after every upgrade and then re-add it to the new template version's Memo form. Of course there are other ways as well, some that are more friendly to users but harder for admins to deal with, and vice versa.

The queue does not exist or you do not have sufficient permissions to perform the operation

When I try to test the queue via the Message Bus. I've checked and permissions are set to full control for everyone. I use 'msmqmng.exe send' from a different machine to put a message onto the queue, it works and is absolutely the message I sent. So what other moving parts might I be missing???
I spent couple of days banging my head for this error, and the root cause was that the storage quota for MSMQ was exceeded! which doesn't seem related to the error message, which makes it a difficult cause to detect...
When sending a message to MSMQ, the sender server will use an outgoing queue located on the sender side, and this outgoing queue is using the storage on that sender server.
The MSMQ component has a maximum quota, defined in the MSMQ properties, and when this quota is exceeded, the above error message starts popping (that's why when you sent from another machine, it worked correctly, since the issue is with the sender not the receiver).
Resolution:
To change this quota, right click on Message Queuing (from Computer management if using Windows server 2003 for example) then properties... (I cannot post images since i am a new user), but in the properties window, you will find in the first tab an editable storage limit field.
To check the currently used storage on the server, open the path of the storage, and check its size: (open the storage tab in the same properties window, and get the path of the storage folder)
If the size of the quota is similar to the size of the storage folder, then this is the root cause of your issue.
If you dont have permission to increase this quota limit, you should have your user added to the "Security" tab in the message queuing properties window.
Hope this helps...
Please vote up if you agree in order for me to have some points and post images in my next answer... :-)
Setting up the queue in Server Manager, Message Queueing I neglected to add the data source name to the queue name. (queue_name_dsNAme) So from one side I was able to insert messages. However, from the Server Group, Message Bus, it automatically appends the data source to the queue to be tested. So, the queue really did not exist.
Turns out there's another twist... even after the naming convention was sorted out there was an application that knew of the queue and was reading from it. When the test message was sent the app grabbed it before the test mechanism had a chance to receive it back, which caused the timeouts. By enabling journaling the message gets put there and you can see what went through the queue. While all this may seem obvious... it pays to ask stupid questions.