commit db7236fb1a1047705352c144f4b8c0edef0cf3af from: mischa date: Sun May 31 14:13:48 2020 UTC get version commit - 8ca2c35a2b6196f28c24398a159b86d9f6d154bb commit + db7236fb1a1047705352c144f4b8c0edef0cf3af blob - /dev/null blob + 1c9616f3ac4a4b3e7b1d0602b1765b20c57b5bc6 (mode 755) --- /dev/null +++ version.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +test -n "$1" || exit 1 +HOST="$1" +COMMUNITY="public" +VERSIONINFO="/tmp/${HOST}-version.txt" + +snmpctl snmp get ${HOST} community ${COMMUNITY} oid sysDescr.0 | awk '{print $3,$4}' > ${VERSIONINFO}