def findManagedServers():
print strftime('%Y%m%d %H:%M.%S') + " INFO: Finding Managed Servers"
try:
global findManagedServerFail
findManagedServerFail = 0
domainConfig()
print "CD to cluster" + clusterAddress
cd('Clusters/' +clusterAddress)
global managedServers
managedServers=cmo.getServers()
global numberofManagedServers
numberofManagedServers=`len(managedServers)`
print strftime('%Y%m%d %H:%M.%S') + " INFO: Found " + numberofManagedServers + " Managed Servers"
except:
global findManagedServerFail
findManagedServerFail += 1
print strftime('%Y%m%d %H:%M.%S') + " FATAL: Error navigating DomainConfig MBean tree for managed servers"
global managedServerState
managedServerState.append(environment + ';' + "Managed Server Name NOT Found" + ';' + " " + ';' + " " + ';' + component + ';' + "FAILEDMSMBEAN")
Name:
2012-08-10 11:13
def getManagedServerState():
domainRuntime()
for servers in managedServers:
managedServerName=servers.getName()
print "Checking MS State of " + managedServerName
try:
print strftime('%Y%m%d %H:%M.%S') + " INFO: Getting " + managedServerName + " Server Status"
cd('/ServerRuntimes/' + managedServerName)
ss = cmo.getState()
hs = cmo.getHealthState()
x = hs.toString().split(',')[1].split(':')[1]
print strftime('%Y%m%d %H:%M.%S') + " INFO: " + managedServerName + ': ' + ss + ': ' + x
cd('../..')
global managedServerState
managedServerState.append(environment + ';' + managedServerName + ';' + ss + ';' + x + ';' + component + ';')
except:
print strftime('%Y%m%d %H:%M.%S') + " WARNING: " + managedServerName + " could NOT be contacted please investigate!"
global managedServersFail
managedServersFail =+ 1
global managedServersErrorCapture
managedServersErrorCapture.append(environment + ';' + managedServerName + ';' + " " + ';' + " " + ';' + component)
global managedServerState
managedServerState.append(environment + ';' + managedServerName + ';' + " " + ';' + " " + ';' + component + ';' + "FAILEDCONNECTMANAGED")
if managedServersFail == numberofManagedServers:
print strftime('%Y%m%d %H:%M.%S') + " FATAL: No Managed Servers Can Be Contacted in Cluster " + clusterAddress
exitCode = -1
def internalServiceBus(component):
if component == INTSB:
try:
domainRuntime()
for server in serverNames:
cd ('ServerRuntimes/intsb_ms1/JMSRuntime/intsb_ms1.jms/JMSServers/idecideserver_1/Destinations/idecideresources!idecideserver_1@idecide.commonerror')
except:
print strftime('%Y%m%d %H:%M.%S') + " Warning: Unable to connect to " + managedServerName
managedServersFail += 1
managedServersErrorCapture.append(server + " Unable to navigate domainRuntime MBean tree, please investigate")
exitCode = -1
def exitDomainState():
print ""
print "---------------------------------------------------"
print " Domain State Checks Complete"
print "---------------------------------------------------"
print ""
print ""
print "The Following Services are Running Without Issue:"
print ""
for smallsEnv in environments:
print smallsEnv
for smallsComponents in components:
for keys in adminServerLog:
key=keys.split(";")
if key[0] == smallsEnv:
if key[4] == smallsComponents:
if key[5] != "FAILEDCONNECTADMIN" and key[5] != "PROPSNOTFOUND":
printcount = 0
while printcount < 1:
print "-" + smallsComponents
print "--Administration Server"
printcount += 1
if key[2] == "RUNNING":
print " INFO: Weblogic Server " + key[1] + " is currently " + key[2] + " " + key[3]
global msprintcount
msprintcount = 0
for keys in managedServerState:
key=keys.split(";")
if key[0] == smallsEnv:
if key[4] == smallsComponents:
if key[5] != "FAILEDCONNECTMANAGED":
while msprintcount < 1:
print "--Managed Servers"
global msprintcount
msprintcount += 1
if key[2] == "RUNNING":
print " INFO: Weblogic Server " + key[1] + " is currently " + key[2] + " " + key[3]
print "---------------------------------------------------"
print ""
print ""
print "---------------------------------------------------"
print "The Following Services have issues :"
print "---------------------------------------------------"
print ""
for smallsEnv in environments:
global smallscount
smallscount = 0
for smallsComponents in components:
for keys in adminServerLog:
key=keys.split(";")
if key[0] == smallsEnv:
if key[4] == smallsComponents:
if key[5] == "FAILEDCONNECTADMIN" or key[5] == "PROPSNOTFOUND" or key[2] != "RUNNING" or key[3] != "HEALTH_OK":
printcount = 0
while printcount < 1:
while smallscount < 1:
print smallsEnv
smallscount += 1
print "-" + smallsComponents
print "--Administration Server"
printcount += 1
if key[5] == "FAILEDCONNECTADMIN":
print " FATAL: Could NOT Connect to " + key[1] + " Administration Server - Check Properties and/or server logs"
if key[5] == "PROPSNOTFOUND":
print " FATAL: Properties NOT found for " + smallsComponents + " Please Check Files"
if (key[2] != "RUNNING") and `len(key[2])` < 1:
print " WARNING: Weblogic Server " + key[1] + " is communicating but has a state of " + key[2] + " check log files"
if (key[3] != "HEALTH_OK") and `len(key[2])` < 1:
print " WARNING: Weblogic Server " + key[1] + " is " + key[2] + " but has a bad health status"
global msprintcount
msprintcount = 0
for keys in managedServerState:
key=keys.split(";")
if key[0] == smallsEnv:
if key[4] == smallsComponents:
if key[5] == "FAILEDMSMBEAN" or key[5] == "FAILEDCONNECTMANAGED" or key[2] != "RUNNING" or key[3] != "HEALTH_OK":
while msprintcount < 1:
while smallscount < 1:
print smallsEnv
print "-" + smallsComponents
smallscount += 1
print "--Managed Servers"
global msprintcount
msprintcount += 1
if key[5] == "FAILEDCONNECTMANAGED":
print " FATAL: Could NOT Connect to Managed Server: " + key[1] + " - server state " + key[2] + " check console and logfiles"
if key[5] == "FAILEDMSMBEAN":
print " ERROR: Failed to traverse Managed Server MBEAN Tree in domainConfig() - Check Admin server health and properties, this error can also be generated if the domain has NO managed servers"
if (key[2] != "RUNNING") and `len(key[2])` < 1:
print " WARNING: Weblogic Server " + key[1] + " is communicating but has a state of " + key[2] + " check log files"
if (key[3] != "HEALTH_OK") and `len(key[2])` < 1:
print " WARNING: Weblogic Server " + key[1] + " is " + key[2] + "but has a bad health status"
global smallscount
smallscount = 0
disconnect()
exit()
Name:
2012-08-10 11:14
try:
environment=sys.argv[1]
component=sys.argv[2]
print "Environment " + environment
if environment == "App1":
global environments
environments = []
environments.extend(["SM1","SM2","SM3",])
global components
components = []
components.extend(["IL2CMS","IL2FORMS","IL2PORTAL","IL3FORMS","IL3COMMS",])
if environment == "App2":
global environments
environments = []
environments.extend(["SM1","SM2","SM3","SM4",])
global components
components = []
components.extend(["BPM","INTSB","EXTSB","OPA","VRD","BULKINTSB","BULKEXTSB",])
if environment == "App3":
global environments
environments = []
environments.extend(["SM1","SM2","SM3",])
global components
components = []
components.extend(["ETL","PORTAL","SB","SP",])
if environment == "ALL":
global environments
environments = []
environments.extend(["SM1","SM2","SM3","SM4"])
global components
components = []
components.extend(["IL2CMS","IL2FORMS","IL2PORTAL","IL3FORMS","IL3COMMS","BPM","INTSB","EXTSB","OPA","VRD","BULKINTSB","BULKEXTSB","ETL","PORTAL","SB","SP",])
for environmentState in environments:
print "Checking and connecting to " + environmentState
for componentState in components:
environment = environmentState
component = componentState
setEnvironmentProperties(environment, component)
if setEnvironmentPropertiesFail == 0:
connectToAdmin()
if connectToAdminServerFail == 0:
findManagedServers()
if findManagedServerFail == 0:
getManagedServerState()
disconnect()
# if setEnvironmentPropertiesFail > 0:
# global managedServerState
# managedServerState.append(environment + ';' + managedServerName + ';;;' + component + ';' + "FAILED")
>>9
this really shows the immense power of js, for all the ``faggots'' that think their language is any good
it makes macros look like a joke
Name:
Anonymous2012-08-10 15:03
I know C in and out, and I've grasped on to some of the core C++/STL stuff.
Recently, I've been wanting to learn Fortran - anyone have any experience with it?
>>25
DO NOT RUN THAT CODE ITS A PASCAL TRIANGLE!!!!!!!
Name:
Anonymous2012-08-11 18:46
>>25
that has more throwaway anonymous functions than a javascript for loop
Name:
Anonymous2012-08-11 18:55
>>27
That's what I was going for. I suppose I could've eliminated all but display and = (numerical equality), in addition to needing string literals, and implemented all other built in functions myself, but that would just make it unreadable. Not to mention, likely to exhaust the stack if I done naively. Please note that I took special care not to use perverted, multiple-argument lambdas.
Name:
Anonymous2012-08-12 1:16
JavaScript is a ``functional'' language. It just has dysfunctional scoping and coercion rules.
Name:
Anonymous2012-08-13 8:05
Halp.. PLZ..... I put a lot of time into a theme, and end of with this stupid arror and I don't know how to fix it.
Also, I'm not super great with PHP, so If there's an obvious fix, I'll kick my self in the nuts for all to see.