How to use wsadmin to stop web server in WAS? - webserver

Please see the screenshot here:
https://developer.ibm.com/answers/questions/381046/how-to-restart-was-web-server.html
Code 1
print AdminConfig.list('WebServer')
================================================================================
/usr/was8/profiles/dmgr/bin/wsadmin.sh -lang jython -conntype SOAP -host localhost -port 8879 -user pubc0ucdw -password **** -f /apps/ubc0/rcl0/agent/var/work/UBC0_Manage_Server/./temp4999862412045425495.py
WASX7209I: Connected to process "dmgr" on node uauswad02Manager using SOAP connector; The type of process is: DeploymentManager
webserver(cells/uauswad02Cell/nodes/uauswad02IHS/servers/webserver|server.xml#WebServer_1334774039656)
Code 2
set cell_name uauswad02Cell
set node_name uauswad02IHS
set web_server_name webserver
set ws [$AdminControl queryNames WebSphere:type=WebServer,cell=$cell_name,*]
$AdminControl invoke $ws stop { $cell_name $node_name $web_server_name}
================================================================================
/usr/was8/profiles/dmgr/bin/wsadmin.sh -lang jacl -conntype SOAP -host localhost -port 8879 -user pubc0ucdw -password **** -f /apps/ubc0/rcl0/agent/var/work/UBC0_EAI_WebShpere/./temp7173819320641687429.jacl
WASX7209I: Connected to process "dmgr" on node uauswad02Manager using SOAP connector; The type of process is: DeploymentManager
WASX7017E: Exception received while running file "/apps/ubc0/rcl0/agent/var/work/UBC0_EAI_WebShpere/./temp7173819320641687429.jacl"; exception information: javax.management.MBeanException
com.ibm.ws.management.webserver.ConfigurationException: Server not found --- Server not found

Change this line:
$AdminControl invoke $ws stop [list $cell_name $node_name $web_server_name]

Related

Attempting to connect to Firebird 2.5 database, getting "-service path\database.FDB:service_mgr" is not defined

I'm trying to run a trace using
fbtracemgr -SE "localhost:C:\Users\user1\Desktop\db.FDB:service_mgr" -user SYSDBA -password masterkey -start -name "to" -config "C:\Users\user1\traceparameter.conf" > c:\Users\user1\dboutput.txt
Cannot attach to services manager
-service C:\Users\user1\Desktop\db.FDB:service_mgr is not defined
Any ideas why this might be?!
I've also tried without :service_mgr and I get the same result.
If I refer to a non existing database (used a random db.FDB filename) I get the same result, so it seems to not be related to the db itself at all?
You need to specify -SE localhost:service_mgr or - local only - -SE service_mgr. The service_mgr specifies you connect to the "Service Manager" of Firebird, not to a specific database. In other words, the database name does not belong in that connection string.
See also Audit and Trace Services in Firebird 2.5.

Perl - Can't get data from metasploit RPC server

What I have used as resource : https://metasploit.help.rapid7.com/v1/docs/rpc-api
First I have started msf rpc server :
msfrpcd -U msf -P test -f -S -a 127.0.0.1
[*] MSGRPC starting on 127.0.0.1:55553 (NO SSL):Msg...
[*] MSGRPC ready at 2019-01-11 00:56:29 +0900.
after that the server is up and is showing up via browser in http://127.0.0.1:55553
The script I have used while using XML::RPC to get data
use XML::RPC;
use strict;
use warnings;
my $fm = XML::RPC->new( 'http://127.0.0.1:55553/api/' );
my $session = $fm->call( 'auth.login', { username => 'msf', password => 'test' });
my $x = $fm->call('group.command'); #api
The error when I run the script :
no data at /usr/local/share/perl/5.26.1/XML/RPC.pm line 288.
It seems that the api used is not working or perphaps something wrong
Do you have any better way to get data from msf rpc server?

Troubles with wget called by script started by Task Scheduler

I need to load a https file. I use wget with option --no-check-certificate. It runs perfectly if started by the ISE-debugger. It even runs perfectly if I started in the cmd-console: ./myScript.ps1. But as soon as I set the Task Scheduler to start my script I get:
--2016-02-07 19:44:01-- https://www.dailyfx.com/calendar/
Resolving www.dailyfx.com... 104.87.22.147
Connecting to www.dailyfx.com|104.87.22.147|:443... connected.
WARNING: cannot verify www.dailyfx.com's certificate, issued by `/C=US/O=GeoTrust Inc./CN=GeoTrust SSL CA - G3':
Unable to locally verify the issuer's authority.
WARNING: certificate common name `fxcm.com' doesn't match requested host name `www.dailyfx.com'.
HTTP request sent, awaiting response... 403 Forbidden
2016-02-07 19:44:01 ERROR 403: Forbidden.
Before calling I set the $ArgList and then I call wget:
$urlDFx = "https://www.dailyfx.com/calendar/"
$argList = "$urlDFx -O $rawDFx -o $logDFx --no-check-certificate"
$wg = Start-Process wget -wait -NoNewWindow -PassThru -ArgumentList $argList
The other variables are various local files.
Again, it works in the ISE and the CMD console but not if started by the Task Scheduler. The other part of the scripts are executed without any problem: I did another http-file and parse it.
What can I do?
I have found a solution even if I don't understand why this now works!
I set:
$argList = "$urlDFx -O $rawDFx -o $logDFx --no-check-certificate --verbose "
1) It works even if the task-scheduler has started the script.
2) The log-file of wget contains absolutely the same as before.
(May be now --verbose is skipped??)

Sending mail service unavailable status

syslog is consistently returning for a specific domain the following result:
relay=mail.domain.tld. [XX.XXX.XXX.XX], dsn=5.0.0, stat=Service unavailable
what is a possible cause of the service unavailability and how can this be resolved?
sendmail (by sendmail.org) - getting outgoing SMTP transcript
As root send a test message with SMTP session tracking. It may provide more hints.
#!/bin/sh
TO=recipient#domain.tld
FROM=someone#your.domain
/usr/sbin/sendmail -v -Ac -i -f$FROM -- $TO <<END
subject: test
to: $TO
from: $FROM
test
END

automated scripting telnet or portqry

Need an advise on how to create an automate script to check connectivity from multiple servers to one server (DB) within Windows server environment either with telnet/portqry and also the script will create a .txt file for unsuccessful connection
Thanks in advance for your help
Claudia
Take a look at IPSentry. We've been using it for a number of years in a mixed Windows/UNIX/Linux environment and found it works well.
Why don't you just ping it?
if ping -q -c 1 yourserver; then
echo 'server is online'
else
echo 'server is offline'
fi
I think this question is similar.
This is bash because you have used bash tag
If you need to check specific port, then you can use this code:
timeout 10 "telnet server port"
if [[ $? == 124 ]]; then # timeout is going to exit with 124 code if it timeouts because of the telnet
echo 'server is online'
else
echo 'server is offline'
fi
Since you claim in the comments that you are really trying to test connectivity into a Sql Server, why not use .Net SqlConnection class? Like so,
$server = "server\instance"
$conStr = "Data Source=$server;Integrated Security=true;Initial Catalog=master;Connect Timeout=3;"
$sqlConn = new-object ("Data.SqlClient.SqlConnection") $conStr
try {
$sqlConn.Open()
if ($sqlConn.State -eq 'Open') {
$sqlConn.Close();
write-host "$server is alive."
} else {
write-host "$server connection problem: $($sqlConn.State.ToString())"
}
} catch {
write-host "$server is unavailable:"
}