Hi,
I wrote a little shell script to get some info from remote host (SNMP) and I want to use this script with RMA for UNIX (located on one of our debians).
On cmd the script is running fine but with RMA (script is in HM script manager) I get "Agent error: Connection error".
Other scripts from script manager are working perfect.
May be the problem is getting info from other remote host or would this be possible?
Christiane
Simple shell script with SNMP to remote host
-
- Posts: 12
- Joined: Tue Nov 15, 2011 2:37 am
-
- Posts: 12
- Joined: Tue Nov 15, 2011 2:37 am
-
- Posts: 12
- Joined: Tue Nov 15, 2011 2:37 am
That was exactly the problem, thanks!!
Now both work fine - the test in RCC an the test in real life
And here ist my sample script:
#!/bin/sh
if [ $# -ge 2 ]
then
diskfree=`snmpget $1 .1.3.6.1.4.1.2021.9.1.7.1 | awk '{print $NF}'`
diskfree=$(($diskfree / 1024 / 1024))
if [ $diskfree -ge $2 ]
then
echo 'ScriptRes:Ok:'$diskfree' GB'
else
echo 'ScriptRes:Bad:'$diskfree' GB'
fi
else
echo 'ScriptRes:Unknown:not enough parameters specified'
fi
I know we can do same test with RMA itself but all of our debians are located in DMZ and we don't want RMA on each of them and open the necessary ports. With shell script / SNMP over one RMA we now are able to monitor all other hosts.
Christiane
Now both work fine - the test in RCC an the test in real life
And here ist my sample script:
#!/bin/sh
if [ $# -ge 2 ]
then
diskfree=`snmpget $1 .1.3.6.1.4.1.2021.9.1.7.1 | awk '{print $NF}'`
diskfree=$(($diskfree / 1024 / 1024))
if [ $diskfree -ge $2 ]
then
echo 'ScriptRes:Ok:'$diskfree' GB'
else
echo 'ScriptRes:Bad:'$diskfree' GB'
fi
else
echo 'ScriptRes:Unknown:not enough parameters specified'
fi
I know we can do same test with RMA itself but all of our debians are located in DMZ and we don't want RMA on each of them and open the necessary ports. With shell script / SNMP over one RMA we now are able to monitor all other hosts.
Christiane