Server Monitoring With munin And monit

Discussion in 'Installation/Configuration' started by kdclaver, Dec 1, 2006.

  1. kdclaver

    kdclaver New Member

    Hello Falko,
    I've seen your beautiful howto about the monitoring and decide to implement it on my server. However I'm face to an error when initiating a command to create the certificate of monit. Below you've the error message :
    ===================================================
    marina:/var/certs# openssl req -new -x509 -days 365 -nodes -config /etc/monit.cnf -out /var/certs/monit.pem -keyout /var/certs/monit.pem
    error on line -1 of /etc/monit.cnf
    18752:error:02001002:system library:fopen:No such file or directory:bss_file.c:104:fopen('/etc/monit.cnf','rb')
    18752:error:2006D080:BIO routines:BIO_new_file:no such file:bss_file.c:107:
    18752:error:0E064072:configuration file routines:CONF_load:no such file:conf_def.c:197:
    marina:/var/certs#

    Thanks for your assistance
     
  2. falko

    falko Super Moderator ISPConfig Developer

    /etc/monit.cnf doesn't exist. You must create it before you run the command.
     
  3. kdclaver

    kdclaver New Member

    How must I create this file ? Must I do it manually ? if yes which are the rights I will put on it 777, 644 ?????

    Thank you for your assistance.
     
  4. falko

    falko Super Moderator ISPConfig Developer

    Why don't you just use /var/certs/monit.cnf as shown in the tutorial?

    Code:
    vi /var/certs/monit.cnf
    Code:
    # create RSA certs - Server
    
    RANDFILE = ./openssl.rnd
    
    [ req ]
    default_bits = 1024
    encrypt_key = yes
    distinguished_name = req_dn
    x509_extensions = cert_type
    
    [ req_dn ]
    countryName = Country Name (2 letter code)
    countryName_default = MO
    
    stateOrProvinceName             = State or Province Name (full name)
    stateOrProvinceName_default     = Monitoria
    
    localityName                    = Locality Name (eg, city)
    localityName_default            = Monittown
    
    organizationName                = Organization Name (eg, company)
    organizationName_default        = Monit Inc.
    
    organizationalUnitName          = Organizational Unit Name (eg, section)
    organizationalUnitName_default  = Dept. of Monitoring Technologies
    
    commonName                      = Common Name (FQDN of your server)
    commonName_default              = server.monit.mo
    
    emailAddress                    = Email Address
    emailAddress_default            = [email protected]
    
    [ cert_type ]
    nsCertType = server
    Code:
    openssl req -new -x509 -days 365 -nodes -config ./monit.cnf -out /var/certs/monit.pem -keyout /var/certs/monit.pem
    openssl gendh 512 >> /var/certs/monit.pem
    openssl x509 -subject -dates -fingerprint -noout -in /var/certs/monit.pem
    chmod 700 /var/certs/monit.pem
     

Share This Page