Send mail with SMTP


#1

Hi everyone ! On first, sorry for my English ^^

It’s possible for NSclient++ (Windows) to send emails to Office 365 (without other server) ? I research a small tool independent to prevent problems on machine (example : CPU utilization more than 95%…).

NSClient alone can do it ?

Thanks.


#2

I cannot provide you the full steps to solve your need. However I can provide you some steps to test a solution by yourself.

Please keep in mind that NSClient++ is not itself a monitoring server solution. It works as an agent on target machines. It listens for events and can respond based on preconfigured settings. The events it may listen for would usually come from a monitoring server, such as OP5 or Nagios.

That said, you can make the response to an event be a Powershell script. This means you can write a PS script that takes in data, turns that into an object, then sends that object to a mail service. Since Office 365 is a Microsoft service, The MS folks have a lot of interesting commandlets you could review:

A reasonable approach would be:

  1. Write a PowerShell script that gathers CPU status details, then sends a response to an email address when a certain threshold is reached;
  2. Make that script the response in an external command entry;
  3. Trigger the external command using a scheduler.