Changes between Version 5 and Version 6 of Nmm2022/Agenda/oxidize


Ignore:
Timestamp:
Jun 28, 2022, 9:10:40 AM (2 years ago)
Author:
dushmantha
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Nmm2022/Agenda/oxidize

    v5 v6  
    2424}}}
    2525
     26'''LibreNMS Integration'''
     27
     28''Create Token as follows''
     29
     30Login to LibreNMS web GUI.
     31Go to Settings -> API Settings[[BR]]
     32
     33[[Image(librenms api settings.png, 600px)]][[BR]]
     34
     35Click on 'Create API access token'.[[BR]]
     36
     37[[Image(librenms create token.png, 600px)]][[BR]]
     38
     39Click 'Create API Token'.
     40
    2641'''Oxidized Configuration'''
    2742
     
    3045{{{
    3146useradd -s /bin/bash -m oxidized
    32 }}}
    33 
    34 Continue with oxidized user.
     47sudo su - oxidized
     48nano .config/oxidized/config
     49}}}
     50
     51Change the configuration file by adding / updating the following information. Replace '''oxidizedfor''', '''cisco''', '''123''' , '''09db454fb0ec6927c777e214c2f82d60''' (LibreNMS token  value) with your corresponding values.
     52 
     53{{{
     54---
     55username: username
     56password: password
     57model: ios
     58resolve_dns: false
     59interval: 600
     60use_syslog: false
     61debug: false
     62threads: 30
     63timeout: 20
     64retries: 3
     65prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
     66rest: 127.0.0.1:8888
     67next_adds_job: false
     68vars:
     69  enable: '123'
     70groups: {}
     71models: {}
     72pid: "/home/oxidized/.config/oxidized/pid"
     73crash:
     74  directory: "/home/oxidized/.config/oxidized/crashes"
     75  hostnames: false
     76stats:
     77  history_size: 10
     78input:
     79  default: telnet, ssh
     80  debug: false
     81  ssh:
     82    secure: false
     83  ftp:
     84    passive: true
     85  utf8_encoded: true
     86output:
     87  default: git
     88  git:
     89    user: Oxidized
     90    email: oxidizedfor@gmail.com
     91    repo: "~/.config/oxidized/oxidized.git"
     92source:
     93  default: http
     94  debug: true
     95  http:
     96    url: http://127.0.0.1/api/v0/oxidized
     97    map:
     98      name: hostname
     99      model: os
     100      group: group
     101    headers:
     102      X-Auth-Token: '09db454fb0ec6927c777e214c2f82d60'
     103groups:
     104  f:
     105    username: 'cisco'
     106    password: '123'
     107hooks:
     108  email_output:
     109    type: exec
     110    events: [post_store, node_fail]
     111    cmd: '/home/oxidized/.config/oxidized/oxidized-report-git-commits -s "Oxidized updates for ${OX_NODE_NAME}" -r oxidizedfor@gmail.com'
     112    async: true
     113    timeout: 120
     114}}}
    35115
    36116'''Setup Oxidized Service'''
     
    63143}}}
    64144
    65 '''LibreNMS Integration'''
    66 
    67 ''Create Token''
    68 
    69 Login to LibreNMS web GUI.
    70 Go to Settings -> API Settings[[BR]]
    71 
    72 [[Image(librenms api settings.png, 600px)]][[BR]]
    73 
    74 Click on 'Create API access token'.[[BR]]
    75 
    76 [[Image(librenms create token.png, 600px)]][[BR]]
    77 
    78 Click 'Create API Token'.
    79 
    80145'''Postfix Installation'''
    81146
     
    90155Put a suitable ''domain name'' for ''System mail name'' and proceed.
    91156
     157'''Gmail Configuration'''
     158
     159Go to your [https://myaccount.google.com/]
     160
     161Select Security.
     162Under "Signing in to Google," select App Passwords.
     163
    92164'''Postfix Configuration'''
    93165
    94 Here Postfix will be configured to send email to your Gmail account.
     166Here Postfix will be configured to send email to your Gmail account. First make sure that you are using ''root'' account.
    95167
    96168{{{
    97169vim /etc/postfix/main.cf
    98170}}}
     171
     172Go through file carefully and add / update the necessary lines as below. Don't fully remove any default line. Some default lines are also depicted in the below configuration to aid positioning lines in the correct place.
    99173
    100174{{{
     
    108182smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
    109183
    110 smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
    111 myhostname = librenms
    112184alias_maps = hash:/etc/aliases
    113185alias_database = hash:/etc/aliases
    114186myorigin = /etc/mailname
    115 mydestination = $myhostname, librenms-demo.com, librenms, localhost.localdomain, localhost
    116187relayhost = [smtp.gmail.com]:587
    117188mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
     
    125196}}}
    126197
    127 
    128 
    129 
    130 
     198{{{
     199vim /etc/postfix/sasl_passwd
     200}}}
     201
     202{{{
     203[smtp.gmail.com]:587 oxidizedfor@gmail.com:gecqeehdvtrrsed5
     204}}}
     205
     206{{{
     207chown root:root /etc/postfix/sasl_passwd
     208chmod 600 /etc/postfix/sasl_passwd
     209postmap /etc/postfix/sasl_passwd
     210systemctl restart postfix
     211}}}
     212
     213Check email sending. Replace '''oxidizedfor''' accordingly.
     214{{{
     215echo "Test Postfix Gmail SMTP Relay" | mail -s "Postfix Gmail SMTP Relay" oxidizedfor@gmail.com
     216}}}
     217