sendemail ERROR => You must specify a 'from' field! Try --help.

Having issues? Post them here, and help other users.
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: sendemail ERROR => You must specify a 'from' field! Try --help.

Post by Robbie Ferguson »

Can some folks in this thread please confirm that they have setup the Nagios Admin email address in NConf Contacts config? I've not been able to replicate the problem yet, and want to find out why you're having trouble. So all I can come up with so far is perhaps you have not configured your contact correctly.

Just drawing at strings here in hopes of pinpointing the problem, and if it is indeed a bug, I'd like to fix it for you. And if it's just that you're not configuring it correctly, I will instead put effort into improving the documentation.

To be clear, go to NEMS NConf, then click "Show" next to "Contacts" in the left menu, then edit your user and confirm you have indeed setup your email address in the config, and yet you are being told in the logs that an email address is missing.

Thanks!
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
baggins
Member
Posts: 50
Joined: Tue Oct 03, 2017 4:46 am

RE: sendemail ERROR => You must specify a 'from' field! Try --help.

Post by baggins »

Hi Robbie,

I can confirm that my email address is correctly set up in NConf and I have the error message...
Of course, the email that Is entered is the email to which the mail should be sent, whereas the error message relates to the 'from' address.
I have of course entered the 'from' address in the NEMS SST

BR
Last edited by baggins on Sun Jan 21, 2018 4:26 am, edited 1 time in total.
Alerty
Junior Member
Posts: 6
Joined: Sat Jan 13, 2018 3:45 pm

RE: sendemail ERROR => You must specify a 'from' field! Try --help.

Post by Alerty »

Yea I been testing few other things out like hardcoding some values in the sendemail command and also checked my NCONF I see my email under contacts I do see its set. I also see the configuration set in the contacts.cfg/resources.cfg. Maybe its the order that its configured? Now under NCONF in contact it has a email address it doesnt say to or from address.


[1516557409.419756] [256.0] [pid=26315] Embedded perl successfully compiled /usr/local/bin/sendEmail and returned plugin handler (Perl subroutine code ref)
[1516557409.628490] [256.0] [pid=29843] Embedded perl ran command /usr/local/bin/sendEmail with output 3, Jan 21 12:56:49 nems p1.pl[29843]: WARNING - The argument after -s was not the server!
Jan 21 12:56:49 nems p1.pl[29843]: WARNING => The argument after -xu was not valid username!
Jan 21 12:56:49 nems p1.pl[29843]: WARNING => The argument after -xp was not valid password!
Jan 21 12:56:49 nems p1.pl[29843]: WARNING => The argument after -f was not an email address!
Jan 21 12:56:49 nems p1.pl[29843]: ERROR => You must specify a 'from' field! Try --help.
**ePN /usr/local/bin/sendEmail: "print() on closed filehandle LOGFILE at (eval 1) line 1137,".
[1516557409.631259] [256.1] [pid=26315] Execution time=0.211 sec, early timeout=0, result=3, output=Jan 21 12:56:49 nems p1.pl[29843]: WARNING - The argument after -s was not the server!
Jan 21 12:56:49 nems p1.pl[29843]: WARNING => The argument after -xu was not valid username!
Jan 21 12:56:49 nems p1.pl[29843]: WARNING => The argument after -xp was not valid password!
Jan 21 12:56:49 nems p1.pl[29843]: WARNING => The argument after -f was not an email address!
Jan 21 12:56:49 nems p1.pl[29843]: ERROR => You must specify a 'from' field! Try --help.
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: sendemail ERROR => You must specify a 'from' field! Try --help.

Post by Robbie Ferguson »

Thanks to you both. Any chance either of you would be willing to send me a current backup.nems? If yes, please email to [email protected] and include a link to this thread so I can connect the two.

There are a few things I'd really like to see from your backup.nems... 1) I want to make sure nems-sst is saving correctly on your systems, 2) I want to be sure the NConf output of the check commands / sendemail commands are correct, 3) I'd like to otherwise dig around and see what on earth is going on and fix it! :p

Thanks!
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
Alerty
Junior Member
Posts: 6
Joined: Sat Jan 13, 2018 3:45 pm

RE: sendemail ERROR => You must specify a 'from' field! Try --help.

Post by Alerty »

is there a way I can look at this backup.nems files clear txt and help figure out what may be the issue?

I can try to rebuild my pi and re configure. Not sure what is the sequence on setting email and notifications up. Thanks.
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: sendemail ERROR => You must specify a 'from' field! Try --help.

Post by Robbie Ferguson »

Baggins sent me his file. Thank you.

Baggins - please run: sudo nems-quickfix

Then when that is done simply open NEMS SST and click save (no need to change anything; just need you to "save" again to see if the update fixes this).

Once done, also please send me a new backup.nems file (wait for 10 minutes or so to make sure the backup file is current) and let me know if the issue is resolved.

A bit of a long shot, but I'll fix little things as I see them and hope one of those things is the one! :p
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: sendemail ERROR => You must specify a 'from' field! Try --help.

Post by Robbie Ferguson »

Alerty, no there would be no reason for you to look at your backup file plain text. The only reason I request it is because it gives me (the developer) insight into the issue. You on the other hand can just browse the NEMS filesystem, but you're better to let me patch it otherwise you could break your NEMS system (it uses Git to update itself, so one single change and your NEMS server will no longer be able to update).

Knowing this, you'd be best to do a PR rather than edit it locally if you spot an issue  :)   See https://docs.nemslinux.com/report-issues
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
baggins
Member
Posts: 50
Joined: Tue Oct 03, 2017 4:46 am

RE: sendemail ERROR => You must specify a 'from' field! Try --help.

Post by baggins »

I'm afraid the error is still there.
Sent you a new backup.

BR

PS. Can it be that the board notifications don't work? I am subscribed to this thread and don't receive an email when someone answers...
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: sendemail ERROR => You must specify a 'from' field! Try --help.

Post by Robbie Ferguson »

That sounds more like spam filter settings or something, unrelated to NEMS.

Okay thanks for the update. I will look for the new file. This helps as it lets me chip away at potential causes and fix little bits and bobs as we go (so it all works out in the end).

To be sure, nems-mailtest works, but notifications do not?
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: sendemail ERROR => You must specify a 'from' field! Try --help.

Post by Robbie Ferguson »

baggins, I still have not received the new backup.nems.
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
Post Reply