Come join our live training webinar every other Wednesday at 11am PST and hear LogicMonitor experts explain best practices and answer common questions. We understand these are uncertain times, and we are here to help!
Due to our collector architecture, our script collector method can only launch scripts from the local collector machine. The collector is not natively able to directly launch files or execute scripts that are present on aremote host.
Generally, it is best practice to avoid remote execution for monitoring purposes, whenever possible. In most cases, it should be possible to serve the information that you would like to monitor via a webpage, API, SNMP, or database connection so that it can be accessed remotely from the collector machine with very little overhead.
But if you are interested in monitoring your files that are remote location, there are extra steps necessary to achieve this. Here is our recommendation:
On the remote host machine, you will need to prepare a basic script that prints to standard output the values that you are interested in monitoring, and then you will need to extend this command into SNMP so that the collector can remotely query your host for this information. The below example uses the Linux “date” utility to output the age of a remote file:
echo "$((`date +%s ` - `date +%s -r dump.sql` ))"
(This would return the age of a file named “dump.sql”, in seconds.)
Once you have a script that captures the value that you want, you will need to extend this script into SNMP. The process has been expertly detailed in our blog posting How to Teach an Old SNMPD New Tricks.
After this has been done, you will need to create a simple SNMP-collecting datasource in LogicMonitor, which allows your collector to query your newly extended OID.
Depending on what exactly you are hoping to monitor on your remote machine, there may be alternatives to remotely access this information:
Remote file monitoring is definitely possible to achieve in LogicMonitor, but do keep in mind that this type of data collection is generally the most intensive to implement, both in terms of strain on your network and the collector itself, as well as the complexity in the design that this type of solution demands.
We advise that you reserve script-based data collection as a last-resort method to obtain the metric(s) that you are after. Other considerations:
In This Article