Community
Command Central
MVP Program
Monthly Mission
Blogs
Groups
Events
Media Vault
Products
Observability
Network Management
Application Management
IT Security
IT Service Management
System Management
Database Management
Content Exchange
SolarWinds Platform
Server & Application Monitor
Database Performance Analyzer
Server Configuration Monitor
Network Performance Monitor
Network Configuration Manager
SQL Sentry
Web Help Desk
Free Tools & Trials
Home
Products
Network Performance Monitor (NPM)
How do I monitor the monitoring services?
hhenry
Hi,
New member here. We had the monitoring service stopped/died on our standalone server with a resulting gap in our data until we discovered it the next day. Does anyone have a utility/script that can check to see if the Solarwind services are not running and send an alert out?
Thanks
Harold
hhenry@dentaquest.com
Find more posts tagged with
Accepted answers
All comments
Vieregg
We are using a Perl script that runs every ten minutes on a Win2003 server to check the most important services. This script sends out mails and SMS if a service fails. Let me know if you want a copy.
Dirk
hhenry
Hello Dirk
Thanks! I would like a copy of it if you don't mind.
Please mail in a zip file to hhenry@dentaquest.com
Best Regards,
Harold
Mithrilhall
Could you send me a copy as well?
email: eqguy2002(at)yahoo(dot)com
stivey79
Dirk,
Could you please send me a copy as well. bstuyvesant@net-cloud.com Thanks in advance!
Bryan
Bryan Stuyvesant
Networking Technologies
NOC Manager
ceclark
Dirk-
Maybe you should just post it!
hoeflchr
Hello Dirk,
I would like a copy as well.
Thanks,
Christian
christian.hoefle@amwins.com
Vieregg
Here we go. Unfortunately it's missing the tabs here.
You need to install Perl on your management server. We run this script every ten minutes by using a scheduler software like AutoTask (
www.cypressnet.com/.../autotask.htm)
or the Windows scheduler.
Regards
Dirk
#####################################################
# using modules
#####################################################
use Win32::Service;
use Mail::Sender;
#####################################################
# variables
#####################################################
$SMTP = 'smtp.acme.com';
$Email = 'admin@acme.com';
$EMailRobot = 'Perl Service Manager<admin@acme.com>';
$Header = "X-Priority: 1 (Highest)";
#####################################################
# subroutines
# The status of the services is tracked in file.
# This way we send out one mail and SMS only if a service fails.
#####################################################
sub ClearStatus
{
foreach $i (keys (%status))
{
delete $status{$i};
}
}
sub Check
{
$Server = $_[0];
$Service = $_[1];
# first we read all services and detect the key name from the long name
Win32::Service::GetServices($Server, \%services);
$ServiceKey = $services{$Service};
open (OldStatusFile, "$Server-$Service.txt");
if (!defined($OldStatus = <OldStatusFile>))
{
$OldStatus = 'not defined';
}
close(OldStatusFile);
print ("checking $ServiceKey on $Server\n");
Win32::Service::GetStatus($Server, $ServiceKey, \%status);
if ($status{CurrentState} != 4)
{
open (OldStatusFile, ">$Server-$Service.txt");
print OldStatusFile "Error";
close(OldStatusFile);
if (($OldStatus eq "OK") or ($OldStatus eq "not defined"))
{
$Subject = "service $Service not running on $Server";
$Body = "Please check \"$Service\" on $Server";
$sender = new Mail::Sender({smtp => $SMTP,
from => $EMailRobot});
$sender->MailMsg({to => $EMail,
subject => $Subject,
headers => $Header,
msg => $Body});
$sender->Close;
# to send as SMS, we just create a file on the server
# SMS-Send (
http://www.smssend.de/)
is used to process these files
# this can be removed if mail is just fine
$FileName = time();
open (Message, ">G:\\SMS\\$FileName.sms");
print (Message $Body);
close (Message);
}
}
elsif ($status{CurrentState} = 4)
{
open (OldStatusFile, ">$Server-$Service.txt");
print OldStatusFile "OK";
close(OldStatusFile);
if ($OldStatus eq "Error")
{
$Subject = "service $Service OK on $Server";
$Body = "\"$Service\" on $Server is up and running";
$sender = new Mail::Sender({smtp => $SMTP,
from => $EMailRobot});
$sender->MailMsg({to => $EMail,
subject => $Subject,
headers => $Header,
msg => $Body});
$sender->Close;
# same SMS thing as above
$FileName = time();
open (Message, ">G:\\SMS\\$FileName.sms");
print (Message $Body);
close (Message);
}
}
ClearStatus;
}
#####################################################
# check ('SERVER', 'SERVICE');
#####################################################
Check('SERVER01', 'SolarWinds Network Performance Monitor');
Check('SERVER01', 'SolarWinds Application Monitor');
Check('SERVER01', 'SolarWinds Wireless Networks');
Check('SERVER01', 'World Wide Web Publishing Service');
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Help
Best Of