logmon Troubleshooting

This articles list the troubleshooting content for logmon probe.
uimpga-ga
This articles list the troubleshooting content for logmon probe.
Contents
logmon_TS
Frequent timeouts when using logmon to call the url_response probe to analyze output from websites
Solution:
The logmon probe is calling url_response probe to gather information for a URLprofile type and works for a limited number of profiles, but not when the trying to check thousands of URLs over a short period of time. Use logmon command issuing a get command, as shown in the following screenshot:
getcommand.JPG
UNIX command profile runs for several minutes but does not return an output
Symptom:
The UNIX logmon command profile must be able to execute the command successfully from the "sh -c" UNIX command. An example of a command that may fail when executed from the "sh -c" command is as follows:
sh -c fline=0;interval=10;timeref=`date +%s`;while [ `date +%s` -lt ` echo $timeref+30|bc` ] ;do while read -r line; do nline=`echo $line | awk '{print $12}'`; fline=`expr $fline + $nline`; done < /proc/diskstats; sleep ${interval}; done; echo $fline
On some Linux systems, this sh command may hang and never return to the prompt. And the logmon probe will experience the same issue.
Solution:
To resolve this issue, include the command, that the logmon profile should execute, in a shell script file and add execute permissions to the shell script. Provide the absolute path to the shell script file for the command to monitor the output.
Follow these steps:
  1. Create the iostat.sh file in the /opt/nimsoft/probes/system/logmon directory with the following contents:
    #! /bin/sh fline=0;interval=10;timeref=`date +%s`;while [ `date +%s` -lt `echo $timeref+30|bc` ] ;do while read -r line; do nline=`echo $line | awk '{print $12}'`; fline=`expr $fline + $nline`; done < /proc/diskstats; sleep ${interval}; done; echo $fline
  2. Add execute permissions to the file, as follows:
    chmod +x /opt/nimsoft/probes/system/logmon/iostat.sh
  3. Change the logmon profile and replace the command with the pathname to the shell script, as follows:
    /opt/nimsoft/probes/system/logmon/iostat.sh
  4. Save the change to the logmon configuration, apply the change, and restart the probe.
    logmon now monitors the outputs of the shell script.