Cant get javax.mail.Session to work? (Groovy Datasource or ConfigSource)
Last week or so I asked a question about using groovy to send emails, and I was pointed to some datasources such as email_TransitTime and etc, to use as a template. I’m just getting a chance to look at that this week. And I hit a snag, and I’m not sure if this is user error or something else. I snagged the code for email_TransitTime and I did what I always do, which is to strip the code down to just the most minimal thing for object creation or for calling the classes etc that I see used, and I immediately hit the problem that the LM Groovy script always tells me: “No such property: Session for class”As it happens on our portal, nobody is even using email_TransitTime, so I cant really be sure, but it seems like something may be wrong on the portal. Here is the code I’m using, this is literally the entirety of the datasource code for now, and I literally just did the imports related to mail that email_TransitTime uses, and then just as that code does, I snag the properties and then try to make a call, without defining anything etc. import com.santaba.agent.groovyapi.expect.Expect; import com.santaba.agent.groovyapi.snmp.Snmp; import com.santaba.agent.groovyapi.http.*; import com.santaba.agent.groovyapi.jmx.*; import org.xbill.DNS.*; //mail? import javax.mail.* import javax.mail.internet.* import javax.mail.search.* //import javax.mail.Session //smtpProps.put("mail.smtp.port", "25"); def smtpProps = System.getProperties(); def smtpSession = Session.getInstance(smtpProps, null); println 0; return 0; So I poked around online for just java and groovy use of javax.mail.Session and I found some similar instances of people having a similar error and they fixed it by putting some other java file somewhere, but I cant control all of this obviously on the LM platform. I guess. But what I’m getting at is that I cant even interact with javax.mail.Session at all, from playing around with it, or trying to import javax.mail.Session directly or anything. Can anyone think of anything obvious going on? I dont see how email_TransitTime could even work on our portal. I’ve never had any issues using classes I’ve seen used in other config sources or datasources, and I’ve even never hit a problem using imports and code examples I see for java generically. I’ve found super simple examples of code online people are doing that basically are doing something just as minimal, and that line “def smtpSession = Session.getInstance(smtpProps, null);” works for them …. at least for those that could get the javax.mail.Session imported or available to them. I’m stumped. Help? :) Thanks!100Views1like2CommentsUsing groovy script to send email (inside a DS or CS)?
We use a resource associated with a specific collector to run scripts using config sources as the mechanism. One of the scripts I am writing now posts to a “UserDisable_Warning” config source a list of users whose suspension is imminent. I would like to use the config source to also send an email to the user, but I’m worried I’m going to have to do a bunch of crazy stuff to set up things on the collector. But I’d rather not use the collector’s exchange to send email, because I dont have direct access to it (go figure) and some of the datasources I’ve seen look like a serious pain to use (Email_TransitTime, for example) as a template. I was wondering if anyone knows a simpler way to send email. When a resource has an alert with an escalation chain that contains an email, I was under the assumption that no exchange server or imap or anything else has to be set up on the collector. Or so I thought. So I’m kinda hoping there is some easy way to avoid having to set up mail stuff on a collector, and just have that collector, via a groovy script, send an email out somehow. Like in my wildest dreams I would import something, and then do java.pipedream.Email.send (“blah@foo.blah”,”LM expiration for blah@foo.blah”,”Dear Blah,\nYour LM account expires in X days.\n\n--MyCompany”). Or at least something not reliant on setting up email servers or clients or etc on the collector. Maybe I’m completely off in the wrong direction. What would be the easiest way to have groovy send an email, preferably with me not having a lot of control of my own collector (even though I’m portal admin; work silos, know what I’m sayin’? :) )? Thanks!352Views3likes7CommentsAdditional Retrieval Method for Email Monitoring
The email monitoring and email round-trip monitors are useful metrics when monitoring an on-premises or hosted email system. One one thing that makes this functionality a bit harder for usto implement is the fact that it uses the IMAP protocol to retrieve messages from the email system. Most of our customers are using Exchange on-premises or Exchange Online. Because IMAP is not the preferred protocol for connecting to an Exchange mailbox, this can present us with some challenges. Some customers may have IMAP functionality completely disabled, or they may block the IMAP ports in their firewall. If we had the option to use one of the HTTPS protocols (possibly EWS?) for email retrieval, that would make this feature much more appealing to us. Another nice to have for our customers with on-premises mail servers, would be the option to send the test not only from the device's collector, but from LogicMonitor's data centers as well.11Views0likes8CommentsAm I missing something: No way to specify email body template?
So we needto email specific alerts to our our ticketing system for storage devices and we noticed that the email body can only be what the Alert Message drop down menu is, specified on the Datasources > Datapoint. Why? Can we not specify a different email body template with this product? We just want to create a new "Alert Message" template that is similar to the usual email body that we've been using in our exiting monitoring solution. I understand we can do a 'customized' alert message but then we'd have to do it on every single data point w/in the data-source. ugh! Am I missing something or is this restricted to this method currently?38Views0likes1CommentToken to include DataSource raw output in email and alert body
We have script DataSources that output useful diagnostics information that help Operations to understand the number valuewhen an alert is generated. We want to include the raw output from a DataSource in the alert and email body. What we need is a##DSRAWOUTPUT## token which contains the complete raw output sent to standard out from a DataSource script. For example, we monitor for processes running under credentials they are no supposed to be running under, and we want to include that info as textual information in the alert/email body.19Views3likes2CommentsReports as body of email instead of attachment
Our CTO is asking me to provide a daily email report of some key metrics to our clients and internal stakeholders. I'm able to create a suitable report and email it, however his concern is the number of clicks to view the report. The belief is that the email will just go straight to trash if our clients can't see the report in the email body. For me, using gmail, I have to download the attachment first, then open it from my laptop. Two options we talked about were: 1. Use the HTML report as the body of the email rather than an attachment (surely the days of text-only email clients are gone) 2. Aconfigurable/dynamic subject to provide some hint of what the report actually contains, e.g. the uptime for a particular service over the last 24 hours.If the subject said "100% Uptime", there is no reason to open the report, if the subject said "98% Uptime" I can open to see more detail. Does anyone else have any ideas on how to makereports a little more effective for asomewhat apathetic audience?11Views3likes7CommentsReceive LM Collector update notifications from LM using integrations.
I understand that at this moment we can only receive LM Collector update notifications by subscribing tohttps://www.logicmonitor.com/releasenotes/which then sends an email when a new version is released. It would be nice to be able to receive such kind of notifications, using email and/or integrations, when the internal LM 'variable' for Settings->Collectors->Updates->Upcoming->version is changing. An addition to that would be some kind of button/link in the notification to process the update for all or some (selected) LM Collectors.1View0likes0CommentsRe-send "new user registration" email button
I think it would be really useful to have a button in every user profile that allows you to "re-send activation email" or "re-send registration email". This way if a user doesn't sign up right away and loses track of the email they got as a new user, you can easily go into their account and re-send that email to them rather than having to reset their password and crafting an email indicating this.4Views0likes0CommentsSend graphs images with Alerts
Hi! Is there a chance that in the near future alerts can go in an email along with a png or jpeg of the moment the alert was triggered? Nowadays we're only getting an external link, which is kind of a pain to check over a phone or something. Thanks! from Mercadolibre S.R.L.4Views0likes4Comments##STEP## variable in service alert templates
We would like to see a ##STEP## variable in the template. It is difficult to determine which part of the site is down by reading the email alert. Current variables in Services Overall Alert template are: Subject ##LEVEL## - ##SERVICE## gets ##VALUE## in ##CHECKPOINT## since ##START## Body Service: ##SERVICE## Checkpoint: ##CHECKPOINT## Description: ##DETAIL## There is the ##URL## variable but it only reflects the main page, not any of the steps.1View0likes0Comments