Can someone point me in a direction to get me past this error?
What the script is doing through SAM is a synthetic type of monitoring to validate SAM is running ok. It runs a powershell script that executes a SyslogGen.exe file to send a log message to Splunk. In Splunk I make a dashboard for heartbeats (syslog messages) for our pollers expecting 1 every 5 minutes. The idea is to give our NOC the visibility of knowing all the polling engines are communicating with the primary server. Any Ideas to do this a better way please share. I am not a powershell person. Thanks!
Script:
$result = & cmd.exe /c "d:\heartbeat_monitor\SyslogGen.exe -t:solarwinds01 -f:1 -s:6 -m:heartbeat" 2>&1 | Out-String
if ($result -Match "Copyright") {Write-Host "Message: Executes every 5 minutes $result"; Write-Host "Statistic: 0"; Exit 0;}
Else
{Write-Host "Message: Command failed to run! $result"; Write-Host "Statistic: 1";Exit 3;}
Heres the error output:
Output: ==============================================
Message: Command failed to run! cmd.exe : 'd:\heartbeat_monitor\SyslogGen.exe' is not recognized as an internal or external command,
At line:1 char:11
+ $result = & cmd.exe /c "d:\heartbeat_monitor\SyslogGen.exe -t:solarwinds01 -f:1 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ('d:\heartbeat_m...ternal command,:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
operable program or batch file.
Statistic: 1