Is it possible to integrate third party services into Nagios (respectively NEMS)? Using the Email Notifications via API would be enough - nagios

I would like to integrate ARP Monitoring in Nagios respectively in NEMS (I need the last active IPs in the Network).
I would also like to integrate a already running script in Nagios which alarms me when the temperature of a sensor is higher then a given value. The notification should be send vias Nagios as an email.
Is it possible to send the notifications via Nagios for example with the API or is there any smarter way to do what I described?

You can set up your personal contact details in contact groups and assign it to the particular host and service.

Related

how to send email on Code Name One using Gmail Api

I want to know if There Is a solution to send an email on a Code Name One app using Gmail Api,
i have an exception When i m using javaxmail,
error: cannot find symbol
import java.util.Properties;
symbol: class Properties
thanks in Advance.
You can use Display.sendMessage to send an email in Codename One. However, this is an "interactive" API that will launch the users email client and he'll need to press send to perform the actual emailing.
Alternatively you can use the sendgrid cn1lib to send an email via sendgrid. I would recommend against that though. If you send an email from the device that means your credentials (password etc.) would be on the device. A better way would be to contact your backend server and ask it to send the email for you. That way a hacker can't decompile your app and find out your credentials.
I agree with Shai's response, I'd just like to add a few more thoughts.
Sending emails from a mobile application (regardless of whether it is developed with Codename One) has two major problems:
the first problem, as mentioned by Shai, concerns the credentials: putting your Gmail account inside the client app code is a very bad idea;
the second problem is specifically about Gmail, since you're not referring to a generic mail service, but to Gmail itself: Stack Overflow is not the place to make recommendations on which services to use, however I can tell you why Gmail is probably not what you want to use. The main problem is that Gmail, when used for "third-party apps" (which Gmail considers insecure), doesn't allow you to change IP addresses frequently: if it notices an IP change, it blocks the service and forces you to manually unblock it in the security settings. Obviously the problem is minor if Gmail is contacted by your server that has a static IP address, but it becomes a big problem if Gmail is contacted directly from your users' phones, each of which will have a different IP.
That said, if your app made with Codename One needs to send emails (e.g. to activate new users), I recommend:
your app can use Codename One's Rest class to make a REST call to your RESTful server backend;
in your server, you could use an alternative service to Gmail that doesn't give problems if you change the server IP address every now and then or if you use the server both locally and remotely. For what is my experience, I can tell you that on my Spring Boot server I use org.springframework.mail.javamail.JavaMailSender, which is compatible with various mail services (just for information, I use a free ZohoMail account, however there may be many other alternative and equally valid mail services that I do not know).
As for using Codename One's Rest class, I'll point you to the developer guide (https://www.codenameone.com/developer-guide.html#_rest_api) and to this blog posts: https://www.codenameone.com/blog/terse-rest-api.html and https://www.codenameone.com/blog/new-rest-calls.html
When making Rest calls with Codename One, always keep in mind that there may be no Internet connection or other connectivity issues (or server-side errors), so careful handling of possible errors is critical.

Gmail API supports a UserID param but how do I setup a Google account with access to multiple mailboxes?

I have an application which needs access to mailboxes for an organization but likely only needs access to the mailboxes for the sales teams and not the mailboxes for the rest of the organization.
For Office 365 we create a service account and get it delegated access to each of the mailboxes it needs to read emails from.
It seems like the Gmail API supports a "userID" parameter.
How can I configure a service account user thru the Admin portal to have access to multiple mailboxes?
Unfortunately this is not possible because a service account acts on behalf of a user who runs the script and does not have the authorization to access other mailboxes.
As a workaround, in the Admin console, the administrator of the domain is able to set up the routing settings for Gmail in a such a way that a copy of all emails addressed to the Sales Team (Organization Unit “Sales Team”) will be delivered to an additional recipient - who will run the API.
When you set-up the routing settings as explained here and add a recipient to whom to deliver a copy of the messages, you can use the option “Advanced”, which allows you to decide to for example to forward attachments or Spam messages as you can see in the image below.
Furthermore, if you don’t want to forward all messages, you can set-up content compliance rules for the inbox of the additional recipient to whom a copy of the messages will be delivered.

How do free SMS apps like Pinger work?

I want to build an app whose core functionality is essentially the same as Pinger and other free SMS apps - that is, it needs to allow for texting without going through your phone's service provider by sending the data over the web. But I can't find any APIs or explanations as to how this is accomplished.
Pinger assigns you a phone number to use, which I assume means it must also run its own SMS gateways. But I don't know how to do either of these things (assign valid phone number and create SMS gateways), or whether I can even do them on my own and purely programatically. Does anybody know where I can find this information?
TL;DR: Essentially, I need to know how to create my own Pinger/free SMS app. My app will be different, but will employ the same underlying functionality.
SMS messages are not free to send and this is why Pinger's business model is based on advertising when you send and receive their messages, see http://www.pinger.com/content/advertise.html
In order to do this yourself you would need to work with one of the companies that offers a SMS gateway. You could use a whole bunch of different providers, take a look at this post I previously made with some of them How to send SMS programatically in a professional and reliable way?
I also add, you would need to work out a suitable business model to pay for the SMS messages you plan to send :-).

How to send and recive text in windows phone using silverlight?

I want to send a message from a windows phone to other windows phone via web services.
How can I do that?
Make use of Push Notifications. They are used to initiate an activity on a phone from a third party. There are three types of them: Tile Notification, Toast Notification and Raw Notification.
Toast Notifications (Example: SMS alert) are received when the application is not running. If for some reason sending from one phone to another implies that both of them run at the same time, consider using Raw Notifications. However, I suppose you should use both of them: if a Raw Notification is dropped (this usually means that the application is not running in the foreground), send Toast Notification.
As far as I undestand your requirements, you should do the following:
Once the application is started (or a user is logged in), establish Push channel and request PushUri for the phone from Microsoft Push Notification Server
Send the PushUri to your service, associate it with the user and save it.
To send a message to a phone application, just pass appropriate parameters to its PushUri. You can do this either from your web service or directly from another phone.
You may find the documentation useful. There are examples of how to establish, send and receive them.
P.S. Take into account that the second Toast Notification may fail as well because during the timespan between two Notifications the user may launch your application. Don't forget to handle this.

Sending Programmatic Email Messages

I'm looking to send email messages programmatically from my websites. For example, if people register their email address, I would like to email them to confirm their email address. To do this I will need to use an email sending tool and plug into an smtp service. In the past (7 or so years ago) I used Jmail, however, I am not sure what are the best services to use today and how spam filters have envolved!
I have three specific questions:
Does it matter which service I use to send emails programmatically (e.g., PhpMail, Jmail, etc.)? If so, which tools would you recommend?
How should I host this tool? I plan on sending a large volume of emails (thousands to hundreds of thousands). Would it make sense to use google-app-engine mail service to do this, or should I just host it on my own server (e.g., have my own SMTP server)?
I don't want my emails to be sent to spam folders, how can I ensure that the emails are received by the users?
Thanks!
No, you don't need your own. Based on the tags of your message, I'm going to assume you are using java and deploying your app on Google App Engine?
http://code.google.com/appengine/docs/java/mail/

Resources