How to generate encrypted passwords in the Nagios server

Publication Date: 2016-11-30Views: 1270Downloads: 0

Issue Description

How to generate encrypted passwords in the Nagios server?

Solution

Step 1:
Run the following command and verify that the OpenSSL function exists on the Nagios server:
# rpm -qa | grep openssl
The following information indicates that the OpenSSL function, which meets the encryption requirements, exists on the Nagios server:
openssl-devel-0.9.8a-18.15 openssl-0.9.8a-18.15 compat-openssl097g-0.9.7g-13.5

Step 2:
Run the following command to encrypt a device password, read and write community or trap community name:
# cd /usr/local/nagios/bin/huawei_server
# python genKey.py encryptPwd
Information similar to the following displays the generated password cipher text:
I2FsdGVkX19RU+Tr4ZoLg4Ji2Rpx4ZGAOeOsqLlxKpI=

NOTE:
The current key is encrypted by the default cipher key of the system. To manually generate a new key,
run the following command and then go to Step 2:
# cd /usr/local/nagios/bin/huawei_server
# python keyhandler.py setkey
If information similar to the following is displayed in the command output, the key is successfully
generated and is automatically saved to the configuration file(configInfo.cfg):
45FsdGVk419RU_2344ZoLg4Ji2Rpx4ZGAOeOsqLlx34=

Step 3:
Record the cipher text for the device password, read and write community or trap community name.
You need to enter this cipher text in the configuration file (huawei_hosts.xml) when adding this device during the installation or device monitoring.