cancel
Showing results for 
Search instead for 
Did you mean: 

Email via the CLI

SOLVED
mattwater
Contributor

Email via the CLI

Guys does anyone know what options are available to send email via the CLI?

I want Stingray to email me once it has completed a task.

However I'm having trouble finding any installed email binary's and apt-get doesn't seem to work.

Example

MYHOST:/etc# apt-get install ssmpt

Reading package lists... Done

Building dependency tree

Reading state information... Done

E: Couldn't find package ssmpt    <-- no matter what you try and install you receive this error.

Any and all help is appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
agosse
New Contributor

Re: Email via the CLI

Hi Mathew,

For apt to work, you would need to populate the repository files in /etc/apt/...

I've done this in the past for the same reason, but installing new packages isn't a "supported" thing (because it might break your system).  If you wish to install extra software, you might prefer using the software distribution, rather than the virtual appliance, because it affords you that flexibility.

Alternatively, if all you need to do is get an email alert out of the traffic manager using the shell, you can (ab)use the internal email event handler script add-email-alert.

  1. First, create an Action (using the UI) that contains your email address.  I modified the existing E-Mail action to test this.
  2. Log in to the traffic manager and issue the following command:

# /opt/zeus/zxtm/bin/add-email-alert -action=E-Mail -eventtype=.Test\ Settings -data='Appears in subject line.'

This will spool a new message for delivery by the traffic manager's alerting system.  If you make a mistake, or the message gets otherwise "stuck", you can find it in the spool directory, in /opt/zeus/zxtm/internal/spool, and delete it.

hth,

--

Alex

View solution in original post

2 REPLIES 2
agosse
New Contributor

Re: Email via the CLI

Hi Mathew,

For apt to work, you would need to populate the repository files in /etc/apt/...

I've done this in the past for the same reason, but installing new packages isn't a "supported" thing (because it might break your system).  If you wish to install extra software, you might prefer using the software distribution, rather than the virtual appliance, because it affords you that flexibility.

Alternatively, if all you need to do is get an email alert out of the traffic manager using the shell, you can (ab)use the internal email event handler script add-email-alert.

  1. First, create an Action (using the UI) that contains your email address.  I modified the existing E-Mail action to test this.
  2. Log in to the traffic manager and issue the following command:

# /opt/zeus/zxtm/bin/add-email-alert -action=E-Mail -eventtype=.Test\ Settings -data='Appears in subject line.'

This will spool a new message for delivery by the traffic manager's alerting system.  If you make a mistake, or the message gets otherwise "stuck", you can find it in the spool directory, in /opt/zeus/zxtm/internal/spool, and delete it.

hth,

--

Alex

mattwater
Contributor

Re: Email via the CLI

Thanks Alex, that's some great advice.

Cheers