<script>
document.location.href = "http://www.thatotherwebpage.com";
</script>
<script>
document.location.href = "http://www.thatotherwebpage.com";
</script>
Posted at 06:23 PM in HTML | Permalink | Comments (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
| |
Posted at 01:52 PM in HP Openview, Perl | Permalink | Comments (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
| |
#!/usr/bin/perl
# Perl script to send email alerts from HP OV events
# Invoked via notification option
# Version 2.8
my $message_id = $ARGV[0];
my $source_node = $ARGV[1];
my $source_node_type = $ARGV[2];
my $date_created = $ARGV[3];
my $time_created = $ARGV[4];
my $date_received = $ARGV[5];
my $time_received = $ARGV[6];
my $application = $ARGV[7];
my $message_group = $ARGV[8];
my $object = $ARGV[9];
my $severity = $ARGV[10];
my $operators = $ARGV[11];
my $message_text = $ARGV[12];
my $instruction = $ARGV[13];
my $cma = $ARGV[14];
my $supp_dup_msgs = $ARGV[15];
use Net::SMTP;
use strict;
use Text::Wrap;
# Wrap the message_text into something more palatable
my $wrap_text = wrap("\t", "", "$message_text\n");
# Configure the mail server IP/name here
my $MAILHOST = '192.168.0.0'; #Insert your SMTP server here
# Configure the email address of the receiver here.
my $address = '[email protected]';
# Configure a name to appear in the 'From' field of the email msg here
my $FROM = '[email protected]';
my $msg = ("Header\n
\n
$source_node had a $severity error on $date_created at $time_created.\n
The Error message is:\n
\n
$wrap_text\n
\n
Footer");
# connect to the smtp server
my $smtp = Net::SMTP->new($MAILHOST, Timeout => 10) or die "Unable to connect to mail host :
$MAILHOST - $!\n";
$smtp->mail($address);
$smtp->to($address);
$smtp->data();
$smtp->datasend("From: $FROM\n");
$smtp->datasend("To: $address\n");
$smtp->datasend("Subject: $source_node has a $severity error.\n");
$smtp->datasend("\n$msg \n\n");
$smtp->datasend;
$smtp->dataend();
$smtp->quit;
open(MYOUTFILE, ">>/var/opt/OV/maillog.log");
print MYOUTFILE "Timestamp: " $source_node “ “ $date_created “ “ $time_created “ “ $message_text “\n”;
close(MYOUTFILE);
Posted at 03:50 PM in Perl | Permalink | Comments (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
| |
#PARAMETERS START
#PARAMETER directory STRING DEFAULT "c:\\temp" VALUE "/sample" SESSION "Directory" CAPTION "Directory to monitor"
my $directory;
$directory = "/sample";
$Session->Value('Directory', $directory);
#PARAMETER threshold INT DEFAULT 100 VALUE 100 SESSION "Threshold" CAPTION "Threshold, Number of Files"
my $threshold;
$threshold = 100;
$Session->Value('Threshold', $threshold);
#PARAMETERS END
use File::Find;
my $size = 0;
find(sub { $size += "1" if -f $_ }, $directory);
$Session->Value('CurrentSize', $size);
if ($size > $threshold)
{
$Rule->Status(1);
}
else
{
$Rule->Status(0);
}
Posted at 01:58 PM in Perl | Permalink | Comments (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
| |
strComputer = "."
Set objWMIService = GetObject ( _
"winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery( _
"Select * from Win32_LocalTime")
For Each objItem in colItems
wscript.Echo "Day: " & objItem.Day & VBNewLine _
& "Hour: " & objItem.Hour & VBNewLine _
& "Minute: " & objItem.Minute & VBNewLine _
& "Year: " & objItem.Year
Next
Posted at 01:12 PM in VB Script | Permalink | Comments (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
| |
Option Explicit
Dim Result
Dim oShell
Dim message
Set oShell = CreateObject("WScript.Shell")
message = "The_timezone_Is_Not_Set_To_Greenwich_Mean_Time and that is bad."
Result = ReadReg("HKLM\System\CurrentControlSet\Control\TimeZoneInformation\StandardName")
'WScript.echo Result
Function ReadReg(RegPath)
Dim objRegistry, Key
Set objRegistry = CreateObject("Wscript.shell")
Key = objRegistry.RegRead(RegPath)
ReadReg = Key
End Function
If Result <> "GMT Standard Time" Then
oShell.Run "cmd /c " & "opcmsg severity=critical application=TimeZone object=monitoring msg_text=The_Timezone_Is_Not_Set_To_Greenwich_Mean_Time."
End If
Posted at 12:08 PM in VB Script | Permalink | Comments (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
| |
strComputer = "."
Set objWMIService = GetObject ( _
"winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery( _
"Select * from Win32_LocalTime")
For Each objItem in colItems
wscript.Echo "Day: " & objItem.Day & VBNewLine _
& "Hour: " & objItem.Hour & VBNewLine _
& "Minute: " & objItem.Minute & VBNewLine _
& "Year: " & objItem.Year
Next
Posted at 11:26 AM | Permalink | Comments (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
| |
#
# Built to determine time difference between node and node's gateway
#
@array = `ipconfig /all`;
foreach $line ( @array )
{
chomp $line;
if ( $line =~ "IP Address" )
{
$ipLine = $line;
if ( $ipLine =~ " 10." )
{
@ipLine = split(": ", $ipLine);
$ip = @ipLine[1];
$ndx = rindex($ip, ".") + 1;
$gateway = substr $ip, 0, $ndx;
$gateway = $gateway . "1";
}
}
}
@result = `w32tm /stripchart /computer:$gateway /dataonly /samples:1`;
foreach $timeLine ( @result )
{
chomp $timeLine;
if ( $timeLine =~ ", " )
{
@arrTime = split(", ", $timeLine);
if ( @arrTime[1] =~ "error: " )
{
print "@arrTime[1]\n";
$timeDiff = "ERR";
}
else
{
$timeDiff = @arrTime[1] / 60;
$timeDiff = round($timeDiff);
}
}
}
if ( $timeDiff eq "ERR" )
{
`opcmsg a=TimeCheck o=TimeCheck msg_t="Time check on node can not communicate with time server." s=critical`;
}
elsif ( $timeDiff >= 2 || $timeDiff <= -2 )
{
`opcmsg a=TimeCheck o=TimeCheck msg_t="Time is off by more than 2 minutes ( approx. difference: $timeDiff minutes ) on node" s=critical`;
}
sub round
{
my $number = $_[0];
return int($number + .5 * ( $number <=> 0));
}
Posted at 11:26 AM in Perl | Permalink | Comments (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
| |
'***************************************
'* Define Variables for script *
'***************************************
Dim objRootLDAP
Dim strDNSDomain
Dim strArray()
Dim n
Dim objNet
'***************************************
'* Get local Domain Info *
'* Do Not Crash if there is no Domain *
'***************************************
On Error resume Next
if err.number = 0 Then
Set objNet = CreateObject("ADSystemInfo")
n = objNet.DomainShortName
end if
'***************************************
'* Function to Check local admins *
'***************************************
function memberOf(groupname)
On Error goto 0
On Error Resume Next
set oUser = GetObject("WinNT://127.0.0.1/" & varUserName & ",user")
' Enumerate Groups for the Use
If err.number = 0 Then
for each oGroup in oUser.Groups
if ucase(oGroup.Name) = ucase(groupName) then
memberOf = true
exit for
end if
next
Else
memberof = False
end if
set oUser = nothing
set oGroup = nothing
end function
'***************************************
'* Function to Check Domain admins *
'***************************************
function memberOfdomain(groupName)
On Error goto 0
On Error Resume Next
set oUser = GetObject("WinNT://" & n & "/" & varUserName & ",user")
If err.number = 0 Then
for each oGroup in oUser.Groups
if ucase(oGroup.Name) = ucase(groupName) then
memberOfdomain = true
exit for
end if
next
Else
memberofdomain = False
end if
set oUser = nothing
set oGroup = nothing
end function
'***************************************
'* Main Part of Script *
'***************************************
Dim ArgObj, varUserName, strCommand
Set ArgObj = WScript.Arguments
varUserName = ArgObj(0)
if memberOf("Administrators") then
strCommand = "cmd /c opcmsg.exe o=Admin_Logon a=Admin_Logon msg_t=""" & varUserName & " has logged in and is a member of the Local Administrators group. ," & varUsername & ",Local"""
runCommand(strCommand)
End If
if memberOfdomain("Domain Admins") then
strCommand = "cmd /c opcmsg.exe o=Admin_Logon a=Admin_Logon msg_t=""" & varUserName & " has logged in and is a member of the Domain Administrators group. ," & varUsername & ",Domain"""
runCommand(strCommand)
End if
sub runCommand(command)
set StdOut = WScript.StdOut
set objShell = CreateObject("WScript.Shell")
set objScriptExec = objShell.Exec (command)
end sub
Posted at 10:50 AM in VB Script | Permalink | Comments (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
| |
#!/bin/sh
PROGNAME=`basename ${0}`
Process=`echo $1` # the process to look for
MonitorName=$2 # ITO monitored object name
tmpNumProcs=`ps -ef | grep "${Process}" | \
grep -v ${PROGNAME} | grep -v grep | wc -l`
NumProcs=`echo ${tmpNumProcs}`
opcmon ${MonitorName}=${NumProcs}
exit $?
Posted at 10:49 AM in HP Openview, Perl | Permalink | Comments (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
| |