diff --git a/tests/p_net-snmp/snmpv1_test.sh b/tests/p_net-snmp/snmpv1_test.sh index eb42841..8931d71 100755 --- a/tests/p_net-snmp/snmpv1_test.sh +++ b/tests/p_net-snmp/snmpv1_test.sh @@ -1,7 +1,7 @@ #!/bin/sh # Author: Athmane Madjoudj -t_Log "Running $0 - snmp test" +t_Log "Running $0 - snmpv1 test" t_InstallPackage net-snmp-utils diff --git a/tests/p_net-snmp/snmpv2c_test.sh b/tests/p_net-snmp/snmpv2c_test.sh index 136a6b4..26b49c5 100755 --- a/tests/p_net-snmp/snmpv2c_test.sh +++ b/tests/p_net-snmp/snmpv2c_test.sh @@ -2,7 +2,7 @@ # Author: Athmane Madjoudj # Author: Christoph Galuschka -t_Log "Running $0 - snmp test" +t_Log "Running $0 - snmpv2c test" t_InstallPackage net-snmp-utils diff --git a/tests/p_net-snmp/snmpv3_test.sh b/tests/p_net-snmp/snmpv3_test.sh new file mode 100755 index 0000000..8fdff53 --- /dev/null +++ b/tests/p_net-snmp/snmpv3_test.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# Author: Athmane Madjoudj +# Author: Christoph Galuschka + +t_Log "Running $0 - snmpv3 test" + +t_InstallPackage net-snmp-utils + +# Make Backup of snmpd.conf and add V3-settings +/bin/cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig +echo 'rouser centosro' >> /etc/snmp/snmpd.conf +echo 'createUser centosro MD5 centosro DES centosro' >> /etc/snmp/snmpd.conf + +# Restart Service +service snmpd restart + +#Run test +snmpget -v 3 -u centosro -n "" -l authPriv -a MD5 -A centosro -x DES -X centosro 127.0.0.1 sysUpTime.0 > /dev/null 2>&1 + +# Restore settings +/bin/cp /etc/snmp/snmpd.conf.orig /etc/snmp/snmpd.conf +service snmpd restart + +t_CheckExitStatus $?