configure: error: unrecognized option: -–with-mail

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

configure: error: unrecognized option: -–with-mail

Post by xlin125 »

I tried to install Nagios Core 4.1.1 (nagios-4.1.1) on a Ubuntu 14.04 VM by following the document "Nagios - Installing Nagios Core From Source". I received an error saying the "-–with-mail" is an unrecognized option:
root@cdf-12:/var/tmp/gfp-sam/nagios-4.1.1# ./configure --with-nagios-group=nagios --with-command-group=nagcmd -–with-mail=/usr/localcw/opt/sendmail/sendmail
configure: error: unrecognized option: -–with-mail=/usr/localcw/opt/sendmail/sendmail
Try `./configure --help' for more information.
root@cdf-12:/var/tmp/gfp-sam/nagios-4.1.1# ls -l /usr/sbin/sendmail
lrwxrwxrwx 1 root root 34 Aug 7 2015 /usr/sbin/sendmail -> /usr/localcw/opt/sendmail/sendmail
root@cdf-12:/var/tmp/gfp-sam/nagios-4.1.1# ls -l /usr/localcw/opt/sendmail/sendmail
-rwxr-sr-x 2 root smmsp 727293 Oct 8 2013 /usr/localcw/opt/sendmail/sendmail

I tried ".configure --help" and verified "--with-mail" is a valid option. Also, either the path to mail /usr/sbin/sendmail (a symbolic link) or /usr/localcw/opt/sendmail/sendmail is valid, but I received the same error from either one. What was wrong? Thanks!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: configure: error: unrecognized option: -–with-mail

Post by ssax »

Please remove the --with-mail option from your configure command and run it again, I believe that document needs to be updated.

Let us know the results.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: configure: error: unrecognized option: -–with-mail

Post by lmiltchev »

According to our developers, "./configure changed *slightly* between 4.1.1 and 4.1.2-RC2." The "-–with-mail" option should work fine in "4.1.2-RC2".
Be sure to check out our Knowledgebase for helpful articles and solutions!
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Re: configure: error: unrecognized option: -–with-mail

Post by xlin125 »

Hi ssax,

Yes, after removing the option "--with-mail" from the configure command line, the configure script ran successfully. Thanks!

Following the same Nagios Core installation document to add a default user for Web Interface Access by running the hpasswd shown below, I received an usage error:
root@cdf-12:/var/tmp/gfp-sam/nagios-4.1.1# htpasswd –c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Usage:
htpasswd [-cimBdpsDv] [-C cost] passwordfile username
htpasswd -b[cmBdpsDv] [-C cost] passwordfile username password

htpasswd -n[imBdps] [-C cost] username
htpasswd -nb[mBdps] [-C cost] username password
-c Create a new file.
-n Don't update file; display results on stdout.
-b Use the password from the command line rather than prompting for it.
-i Read password from stdin without verification (for script usage).
-m Force MD5 encryption of the password (default).
-B Force bcrypt encryption of the password (very secure).
-C Set the computing time used for the bcrypt algorithm
(higher is more secure but slower, default: 5, valid: 4 to 31).
-d Force CRYPT encryption of the password (8 chars max, insecure).
-s Force SHA encryption of the password (insecure).
-p Do not encrypt the password (plaintext, insecure).
-D Delete the specified user.
-v Verify password for the specified user.
On other systems than Windows and NetWare the '-p' flag will probably not work.
The SHA algorithm does not use a salt and is less secure than the MD5 algorithm.

I do not see anything wrong with this command and syntax. What went wrong this time? Thanks!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: configure: error: unrecognized option: -–with-mail

Post by mcapra »

Try the following:

Code: Select all

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
It looks as if that document didn't encode the - character correctly. Copying the above should work.
Former Nagios employee
https://www.mcapra.com/
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Re: configure: error: unrecognized option: -–with-mail

Post by xlin125 »

Hi mcapra,

Yes, I copied yours, and ran it. It works. Thank you!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: configure: error: unrecognized option: -–with-mail

Post by mcapra »

Awesome! Where there any additional issues you were encountering with your Core installation? Is it alright if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Re: configure: error: unrecognized option: -–with-mail

Post by xlin125 »

There were some minor issues during the Nagios Core installation:
- zip/unzip was not installed on the system. So I just did apt-get to install it, and re-ran the make command
- /etc/httpd/conf.d directory did not exist for file copy, so I created it and re-ran the make command to get this copy done
- htpasswd was not installed, so I did an apt-get to install the required packages. I did follow the instruction to run apt-get to install the prerequisites for Ubunto before running the configure script to start the installation. Not sure why this htpasswd was missing.

After correctly following the procedures to install the Nagios Core 4.1.1 and Nagios Plugins 2.1.1, I tried to access the Nagios Core installation from a web browser, and I received a timeout error. I verified that the port 80 on this server is accessible (telnet <nagios.server.ip> 80). Not sure what is missing. This issue is under investigation. Any suggestions? Thanks.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: configure: error: unrecognized option: -–with-mail

Post by Box293 »

I suspect configure needed some extra arguments:

Code: Select all

--with-httpd-conf=/etc/apache2/sites-enabled
This guide is a bit old but it might help.

http://sites.box293.com/nagios/guides/i ... untu-14-04
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Re: configure: error: unrecognized option: -–with-mail

Post by xlin125 »

Box293,

Thanks for the information.

Yes, according to the guide "Nagios - Installing Nagios Core From Source" on the Nagios library website, the option "--with-httpd-conf=/etc/apache2/sites-enabled" for configure is not required. It looks like this option is used to set path to Apache conf.d directory. If this option is required, what needs to be done to check the setting and fix it, if something is not done or missing? There are some differences between this official guide and the Nagios Core installation guide at http://sites.box293.com/nagios/guides/i ... untu-14-04. And we know now that the option "-–with-mail" is not needed. Hope to see an updated official guide on the Nagios Library website. Thanks!
Locked