Changes between Version 5 and Version 6 of Nmm2022/Agenda/oxidize
- Timestamp:
- Jun 28, 2022, 9:10:40 AM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Nmm2022/Agenda/oxidize
v5 v6 24 24 }}} 25 25 26 '''LibreNMS Integration''' 27 28 ''Create Token as follows'' 29 30 Login to LibreNMS web GUI. 31 Go to Settings -> API Settings[[BR]] 32 33 [[Image(librenms api settings.png, 600px)]][[BR]] 34 35 Click on 'Create API access token'.[[BR]] 36 37 [[Image(librenms create token.png, 600px)]][[BR]] 38 39 Click 'Create API Token'. 40 26 41 '''Oxidized Configuration''' 27 42 … … 30 45 {{{ 31 46 useradd -s /bin/bash -m oxidized 32 }}} 33 34 Continue with oxidized user. 47 sudo su - oxidized 48 nano .config/oxidized/config 49 }}} 50 51 Change the configuration file by adding / updating the following information. Replace '''oxidizedfor''', '''cisco''', '''123''' , '''09db454fb0ec6927c777e214c2f82d60''' (LibreNMS token value) with your corresponding values. 52 53 {{{ 54 --- 55 username: username 56 password: password 57 model: ios 58 resolve_dns: false 59 interval: 600 60 use_syslog: false 61 debug: false 62 threads: 30 63 timeout: 20 64 retries: 3 65 prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/ 66 rest: 127.0.0.1:8888 67 next_adds_job: false 68 vars: 69 enable: '123' 70 groups: {} 71 models: {} 72 pid: "/home/oxidized/.config/oxidized/pid" 73 crash: 74 directory: "/home/oxidized/.config/oxidized/crashes" 75 hostnames: false 76 stats: 77 history_size: 10 78 input: 79 default: telnet, ssh 80 debug: false 81 ssh: 82 secure: false 83 ftp: 84 passive: true 85 utf8_encoded: true 86 output: 87 default: git 88 git: 89 user: Oxidized 90 email: oxidizedfor@gmail.com 91 repo: "~/.config/oxidized/oxidized.git" 92 source: 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' 103 groups: 104 f: 105 username: 'cisco' 106 password: '123' 107 hooks: 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 }}} 35 115 36 116 '''Setup Oxidized Service''' … … 63 143 }}} 64 144 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 80 145 '''Postfix Installation''' 81 146 … … 90 155 Put a suitable ''domain name'' for ''System mail name'' and proceed. 91 156 157 '''Gmail Configuration''' 158 159 Go to your [https://myaccount.google.com/] 160 161 Select Security. 162 Under "Signing in to Google," select App Passwords. 163 92 164 '''Postfix Configuration''' 93 165 94 Here Postfix will be configured to send email to your Gmail account. 166 Here Postfix will be configured to send email to your Gmail account. First make sure that you are using ''root'' account. 95 167 96 168 {{{ 97 169 vim /etc/postfix/main.cf 98 170 }}} 171 172 Go 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. 99 173 100 174 {{{ … … 108 182 smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt 109 183 110 smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination111 myhostname = librenms112 184 alias_maps = hash:/etc/aliases 113 185 alias_database = hash:/etc/aliases 114 186 myorigin = /etc/mailname 115 mydestination = $myhostname, librenms-demo.com, librenms, localhost.localdomain, localhost116 187 relayhost = [smtp.gmail.com]:587 117 188 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 … … 125 196 }}} 126 197 127 128 129 130 198 {{{ 199 vim /etc/postfix/sasl_passwd 200 }}} 201 202 {{{ 203 [smtp.gmail.com]:587 oxidizedfor@gmail.com:gecqeehdvtrrsed5 204 }}} 205 206 {{{ 207 chown root:root /etc/postfix/sasl_passwd 208 chmod 600 /etc/postfix/sasl_passwd 209 postmap /etc/postfix/sasl_passwd 210 systemctl restart postfix 211 }}} 212 213 Check email sending. Replace '''oxidizedfor''' accordingly. 214 {{{ 215 echo "Test Postfix Gmail SMTP Relay" | mail -s "Postfix Gmail SMTP Relay" oxidizedfor@gmail.com 216 }}} 217