Location of Websphere Application Server config files - eclipse

I have a Websphere Application Server v8.0, and my job requires me to change the location of my JDBC data source to different values to test in different environments. I traditionally would do this via the admin console and change the settings via the Resources > JDBC > Data sources section, but I'd like to write a script to change these settings. When I run the admin console, where do the settings get stored? I can run the console vis-a-vis the Servers tab in Eclipse (Rational Application Developer) or by navigating to localhost:9044, but I don't know where the settings are stored - which I'd need to write said script.
Can anybody help me out?

From what I remember of WebSphere Application Server, the settings are ultimately persisted to the file system - however you shouldn't be changing them this way because application server config is a messy and complicated business and by directly changing settings you risk destroying your app server.
I'd recommend checking out this redbook, particularly Chapter 8 which describes how you can configure your app server with scripts. Also I seem to recall plans to display the equivalent scripting commands in the admin console.

If it helps, I had a quick look locally and found a reference to my JDBC data source in "resources.xml" located within the websphere directory at...
<server profile root>\config\cells\<aNodeCell>\nodes\<aNode>\servers\<aServer>
In the past I've used xml config to read values for convenience, but not often to update. Instead I have made use of some of the jython script options available and can echo Jim's response to check out the options there in case there is something that would be a viable alternative.
Edit:
There is another link that may be of interest Configuring data access with wsadmin scripting. I've not used this particular feature of wsadmin myself but it does appear to show promise at first glance.

If you want to write a script, then rather than looking at file system write a proper jython script, which will do your modifications in the similar way as you would do it via console.
To make writing script easier you can use:
Command assistance in the console - the Help portlet on the right shows last invoked command in jython
Script library, which already provides some scripts - Automating data access resource configuration using wsadmin scripting
And basic scripting commands - Configuring data access with wsadmin scripting

Related

Automated execution of a powershell script on Active Directory, Triggered from a web page

I am proposing an idea for a final year project that is basically a virtual environment. I would be using Citrix XenServer in conjunction with Windows Server 2008 R2 and Citrix netscaler to make the server accessible over the web. I would also be hosting a website on the server that Windows is on.
What I was wondering is, would it be possible to trigger the execution of a script on the server from the web page. So basically a user comes along, goes to my website, registers their details. a csv file is then produced based on the details that are input. Then I was wondering is there a way to trigger the execution of a powershell script that would use the csv file to set up the user in Active directory. The powershell script itself is simple its just how I would get it to run is another thing.
Yes it is possible.
PowerShell lets us create graphical interfaces with the .NET winforms. With it, we can build front end to manage our scripts. It's a really nice feature, and tools like AdminScriptEditor make it pretty easy.
I have found this link for your reference - PowerShellOnWebPage
You can tweak/create the script as per your need.
Let me know if this helps.
Thanks!

Export current DSC configuration for import to another server (using IIS website as an example)

I'm trying to wrap my hand around DSC in PowerShell 4.0, what's possible, and what's not. I've installed xWebAdministration Module.
Could I create a website in IIS, then somehow export it to the a .ps1 file (I think in the MOF format). For example, txWebAdministration has a sample called xWebAdministration\Examples\Sample_xWebsite_NewWebsite.ps1. Could I use an existing website to build a file like this? Or do I have to type everything in manually?
I'm basically trying to jump in and try some things without reading from end-to-end. I was hoping Get-DscConfiguration would somehow read my IIS configuration and create such a file.
For example, in SQLServer, you can create a database and tables using the graphical user interface of SQL Studio Management Studio (SSMS), then export a script to re-create those same tables on another server.
Is such a concept possible with DSC, or am I missing the boat.
There is nothing like this at the moment.
Keep in mind DSC is very new and quite sparse. The DSC Resource Kit is created by people at Microsoft, but isn't supported or all that official.
You could write a script to parse an existing web site and export it to a configuration in a PS1, or even directly into an MOF (it's a text file too), but there is nothing close to this functionality existing at the moment.
Your best bet is probably to type it out manually at this time.
There is a tool that creates a DSC configuration from an existing machine called GuardRail but I think it will not support the experimental xWebAdministration Module. As briantist said, it wouldn't be too difficult to create a powershell script that uses WebAdministration commandlets to produce a DSC configuration.
In fact a workmate asked me the same question today and I'm considering writing one. If you I'll update my answer in a few days with a script that will do this.

Launch ColdFusion from command line

Is there a way to launch ColdFusion from the command-line?
I am not talking about launching the CF and related services with the net start command.
I remember doing this in the past. Basically, running CF from the command-line offered two advantages:
You didn't need to keep it as a Service and either have it always launch at boot-up or have to deal with the Services Manager
(more importantly) It echoed back to the screen all kinds of messages, especially error messages, which were helpful when actively developing (because you didn't need to go dig in the ColdFusion log files to find them)
It is possible that I'm mis-remembering and that this hasn't been available since ColdFusion 5.0. Is it at all possible with ColdFusion 9?
Update: Environment: Multi-server configuration with JRun.
Two ways to do this:
In development, add the server to ColdFusion Builder, and all the messages you talk about will show up in the console tab.
Start ColdFusion from the command line. The instructions are slightly different per environment but basically you want to get to bin directory and issue jrun start cfusion or coldfusion start or something similar . Post your environment for more specifics.
Go to C:\JRun\bin and issue jrun start cfusion
In your ColdFusion9/bin Folder you can find stop.bat and start.bat. Executing the latter gives you exactly what you want.

Automated deployment of Check Script for Nagios

We currently use Ant to automate our deployment process. One of the tasks that requires carrying out when setting up a new Service is to implement monitoring for it.
This involves adding the service in one of the hosts in the Nagios configuration directory.
Has anyone attempted to implement such a thing where it is all automated? It seems that the Nagios configuration is laid out where the files are split up so that they are host based, opposed to application based.
For example:
localhost.cfg
This may cause an issue with implementing an automated solution as when I'm setting up the monitoring as I'm deploying the application to the environment (i.e - host). It's like a jigsaw puzzle where two pieces don't quite fit together. Any suggestions?
Ok, you can say that really you may only need to carry out the setting up of the monitor only once but I want the developers to have the power to update the checking script when the testing criteria changes without too much involvement from Operations.
Anyone have any comments on this?
Kind Regards,
Steve
The splitting of Nagios configuration files is optional, you can have it all in one file if you want to or split it up into several files as you see fit. The cfg_dir configuration statement can be used to have Nagios pick up any .cfg files found.
When configuration files have changed, you'll have to reload the configuration in Nagios. This can be done via the external commands pipe.
Nagios provides a configuration validation tool, so that you can verify that your new configuration is ok before loading it into the live environment.

What is Zend's console? When do you use this console?

Does any one know what is the use of Zend's console?
any sample program ?
Console = the shell, or command line. If you have Windows go to Run and enter 'cmd', if you have a Mac open Terminal. Console scripts are useful for long processes or things you want to schedule to occur on a regular basis (the 'cron' RaYell refers to).
For example, I wrote a link checker script for checking links for websites we develop. It's used to help QA sites and check for errors. That command looks something like:
php linkchecker.php http://www.domain.com
The third bit is any arguments that are passed to the script. These can easily be accessed via Zend Console Getopt which is the only stable component of Zend_Console I'm aware of.
More info on Zend Console Getopt - http://framework.zend.com/manual/en/zend.console.getopt.html
There are details of Zend Console itself which are on the developer wiki, but I don't know if this is currently being developed - http://framework.zend.com/wiki/display/ZFPROP/Zend_Console+-+Wil+Sinclair
Zend console allows you to write console apps in PHP. It can be very useful if i.e. you want to run certain actions of your app with CRON.