SQLPLUS helps with a Linux Script
I get an error SQLPLUS to 155.Apparently my SQL code is truncated (I think).
Initially, I had all this code on separate lines to make it readable. Unfortunately for this test, I also received a return code of 155.
I copied the SQL of my SQL DEVELOPER where this SQL works correctly.
Can anyone make suggestions?
BTW, I am newbie to Linux Shell, SQL and SQLPLUS Scripts.
Here is the log of the execution of the script:
SQL * more: Production release 11.2.0.2.0 on Friday, may 4, 17:49:38-2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL > SQL > connect.
SQL > SQL > SQL > SELECT to_char (c.update_date, 'FMMonth, YYYY') 'Date of update of shipping' |' | ' || b.SHIPMENT_GID 'Expedition number' |' | ' || Count (distinct (b.SHIPMENT_GID)) 'of the expeditions' |' | ' || Count (distinct (a.i_transaction_no)) 'Auction by expedition' |' | ' || Count (*) 'notified carriers no' |' | ' || sum (where the a.responding_gl_user_gid is null then 0 otherwise 1 end) 'No bidders' |' | ' || min (numtodsinterval ((b.expected_response-b.insert_date),'day "")) 'Time of auction' |'| ' | min (numtodsinterval ((a.update_date-a.transaction_time),'day "")) 'Elapse time for first auction' |'| ' | Max (numtodsinterval ((a.update_date-a.transaction_time),'day "")) 'Elapse time for the last bid' |'| ' | NUMTODSINTERVAL ((Max (a.update_date) - min (a.update_date)), 'day') 'Elapse time of auction' |' | ' || NUMTODSINTERVAL ((Max (b.shipment_time) - max (c.insert_date)), 'day') 'Driving time to bid to P/U' |' | ' || (max (a.bid_amount) - min (a.bid_amount)) "High bid - low-bid Diff" of tender_collab_servprov a, tender_collaboration b, c of the expedition where a.i_transaction_no = b.i_transaction_no and b.shipment_gid not in (select sqa.shipment_gid from the sqa, CBRS tender_collab_servprov tender_collaboration where sqa.i_transaction_no = sqb.i_transaction_no and sqb.acceptance_code = 'A') and a.i_transaction_no in (select i_transaction_no from the tender_collaboration where tender_type = 'Offered Spot') and b.shipment_gid = c.shipment_gid AND c.update_date > = trunc (last_ day (to_date ((to_char (ADD_MONTHS (sysdate-2), 'DD-MM-YYYY')), "MM-DD-YYYY")) + 1) Group c.update_date, b.SHIPMENT_GID order of c.update_date, b.shipment_GID
*
ERROR on line 1:
ORA-00923: THE KEYWORD not found where expected
Disconnected from the database to Oracle 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
With partitioning, OLAP, Data Mining and Real Application Testing options
Here is the Linux Shell script:
/ bin/sh
LOGFILE = "$(date +" %A-%m-%j %H ") REPORT Oracle LOG. TXT ".
FILENAME = "$(date +" %Y-m %-%d ")" PROD unfinished Spot Bids.CSV ""
echo "filename for the coil is: ' '$FILENAME '.
#spool "$FILENAME".
sqlplus/nolog < < EOF > $LOGFILE
whenever sqlerror exit sql.sqlcode
connect glog_read/parker@OTMDEV
coil PROD_Unfinished.CSV
Set linesize 32000 trimspool on pagesize 3000
SELECT to_char (c.update_date, 'FMMonth, YYYY') 'Date of update of shipping' |' | ' || b.SHIPMENT_GID 'Expedition number' |' | ' || Count (distinct (b.SHIPMENT_GID)) 'of the expeditions' |' | ' || Count (distinct (a.i_transaction_no)) 'Auction by expedition' |' | ' || Count (*) 'notified carriers no' |' | ' || sum (where the a.responding_gl_user_gid is null then 0 otherwise 1 end) 'No bidders' |' | ' || min (numtodsinterval ((b.expected_response-b.insert_date),'day "")) 'Time of auction' |'| ' | min (numtodsinterval ((a.update_date-a.transaction_time),'day "")) 'Elapse time for first auction' |'| ' | Max (numtodsinterval ((a.update_date-a.transaction_time),'day "")) 'Elapse time for the last bid' |'| ' | NUMTODSINTERVAL ((Max (a.update_date) - min (a.update_date)), 'day') 'Elapse time of auction' |' | ' || NUMTODSINTERVAL ((Max (b.shipment_time) - max (c.insert_date)), 'day') 'Driving time to bid to P/U' |' | ' || (max (a.bid_amount) - min (a.bid_amount)) "High bid - low-bid Diff" of tender_collab_servprov a, tender_collaboration b, c of the expedition where a.i_transaction_no = b.i_transaction_no and b.shipment_gid not in (select sqa.shipment_gid from the sqa, CBRS tender_collab_servprov tender_collaboration where sqa.i_transaction_no = sqb.i_transaction_no and sqb.acceptance_code = 'A') and a.i_transaction_no in (select i_transaction_no from the tender_collaboration where tender_type = 'Offered Spot') and b.shipment_gid = c.shipment_gid AND c.update_date > = trunc (last_ day (to_date ((to_char (ADD_MONTHS (sysdate-2), 'DD-MM-YYYY')), "MM-DD-YYYY")) + 1) Group c.update_date, b.SHIPMENT_GID order of c.update_date, b.shipment_GID;
spool off
EXPRESSIONS OF FOLKLORE
RV = $?
ECHO "fronm the sqlplus return code was: ' «$RV»»»
HM wrote:
@Billy: empty lines are possible in a query in sqlplus:
set sqlblanklines on
It is not enabled by default. I've never seen any SQL * more script start. :-)
Tags: Database
Similar Questions
-
Help with the Powershell script to collect logs from all domain controllers
I am writing a script to retrieve the last 5 days of application, security and log files from all domain controllers. The script runs, but fire the logs from the local server only. The variable $Computer has all of my DC so it's the fine mark. I guess it's a problem with my line ForEach-Object, but is not error. See the below script.
$log = 'application '.
$date = get-date-format MM-DD-YYYY
$now = get-date
$subtractDays = new-object System.TimeSpan 5,0,0,0,0
$then = $Now.Subtract ($subtractDays)
$Computers = get-ADDomainController-filter *.
ForEach-Object - InputObject $Computers - process {Get-EventLog - LogName $log - after $then - before $now - EntryType error | select EventID, MachineName, Message, Source, TimeGenerated |} ConvertTo-html | {Out-file $env:TEMP\Applicationlog.htm}
Invoke-Expression $env:TEMP\Applicationlog.htmThank you
Rich
Hello
To help with the repost the question script to the script Center Forum
http://social.technet.Microsoft.com/forums/scriptcenter/en-us/home
-
Need help with installing Linux on Satellite Pro A300
Hello
I would like to install Linux on my laptop and am wondering which is the best distribution I can use and is it simple to follow guide to use so I'll get to the top and running with a dual boot with Microsoft Windows Vista?
Please help because it is really important to me!
Appreciate your help in advance.
Thank you
Bill.Hello
To be honest I didn't install Linux on my laptop with Vista and XP.
Sometimes, I use Linux Live distribution called Koppix, and I m satisfied!The devices have been recognized, and most of the drivers were included.
Maybe it s an option for you too
But Ubuntu might also be interesting for you.
Check this box:
http://www.Ubuntu.com/ -
Hello everyone.
Can sb help me create the following script, based on three tables:
ID col1 314 value2 ID ID1 col2 314 1 somevalue4 314 2 somevalue5 314 3 somevalue6 ID ID1 ID2 COD Qty. 314 1 1 LTR 10 314 1 2 KG 20 314 2 1 LTR 40 The result should be like this:
id id1 ID2 cod_1 qty_1 COD2 qty_2 col1 col2 314 1 1 LTR 10 KG 20 value2 somevalue4 314 2 1 LTR 40 value2 somevalue5 Post edited by: 933651
Hello
Here is my view on this problem. May need some adjustments in the join conditions when the data model and the data is more clear
create table t1 ( id number, col1 varchar2(10) ); insert into t1 values (314, 'somevalue2'); create table t2 ( id number, id1 number, col2 varchar2(10) ); insert into t2 values (314, 1, 'somevalue4'); insert into t2 values (314, 2, 'somevalue5'); insert into t2 values (314, 3, 'somevalue6'); create table t3( id number, id1 number, id2 number, cod varchar2(3), qty number ); insert into t3 values (314, 1, 1, 'LTR', 10); insert into t3 values (314, 1, 2, 'KG', 20); insert into t3 values (314, 2, 1, 'LTR', 40); with ltr as ( select id, id1, id2, cod, qty from ( select id, id1, id2, cod as code, cod, qty from t3 ) pivot ( sum(qty) for code in ('LTR' as qty) ) where qty is not null ), kg as ( select id, id1, id2, cod, qty from ( select id, id1, id2, cod as code, cod, qty from t3 ) pivot ( sum(qty) for code in ('KG' as qty) ) where qty is not null ) select t2.id, t2.id1, ltr.id2, ltr.cod, ltr.qty, kg.cod, kg.qty, t1.col1, t2.col2 from t2 join ltr on ( t2.id = ltr.id and t2.id1 = ltr.id1 ) full join kg on ( t2.id = kg.id and t2.id1 = kg.id1 ) left join t1 on ( t1.id = t2.id ) order by id, id1 ; drop table t1 purge; drop table t2 purge; drop table t3 purge; table T1 created. 1 rows inserted. table T2 created. 1 rows inserted. 1 rows inserted. 1 rows inserted. table T3 created. 1 rows inserted. 1 rows inserted. 1 rows inserted. ID ID1 ID2 COD QTY COD QTY COL1 COL2 ---------- ---------- ---------- --- ---------- --- ---------- ---------- ---------- 314 1 1 LTR 10 KG 20 somevalue2 somevalue4 314 2 1 LTR 40 somevalue2 somevalue5 table T1 dropped. table T2 dropped. table T3 dropped.
-
Need help with understanding PowerCli scripting by LucD
Hello
I'll give you the standard statement that I am a noob powercli and don't really know what I'm doing here. Here's a script that works because it runs without error and gives a report but I need help to understand this under his weight.
Connect-VIServer '< our vcenter >' - user < user > admin-password < admin-user-pwd >
$allvms = @)
$vms = get - Vm | where {$_.} PowerState - eq "Receptor"}
$start = (get-Date). AddDays(-1)
$metrics = "mem.usage.average".
$stats = get-Stat-entity $vms - start $start - Stat $metrics
$stats | Group-object - property {$_.} Timestamp.Day}, {$_.} @entity.name} | %{
$vmstat = "" | Select the day, MemAlloc, MemMin, MemMax, MemAvg, VmName
$vmstat. VmName = $_. Values [1]
$vmstat. Day = $_. Group [0]. Timestamp.Date
$mem = $_. Group | where {$_.} MetricId - eq "mem.usage.average"} | Measure-object-property value - average - Maximum - Minimum
$vmstat. MemMax = [int] $mem. Maximum ##dfsdf
$vmstat. MemAvg = [int] $mem. Average
$vmstat. MemMin = [int] $mem. Minimum
$vmstat. MemAlloc = $_. Group [0]. Entity.MemoryMB
$allvms += $vmstat
}
$allvms |
Export-Csv "c:\ < folder > \ <>.csv file Destination"-noTypeInformation
It connects to our server vcenter server and offers two days of data. Today and yesterday, all with a timestamp of 0:00. See below for an example of a virtual machine.
VmName Day MemAlloc MemMax MemAvg MemMin < name VM1 > 07/05/2016 0:00 4096 18 18 18 < name VM1 > 06/05/2016 0:00 4096 36 12 8
The MemMax, the MemAvg and the MemMin are for this day? Just the max of this period of sampling time 0:00?
What I'm looking for, it is to find that the use of the maximum memory of virtual machines are for the whole day. So I hope that I can remove memory of VMs that do not use it. I was listed on the change $start = (Get-Date). The value of AddDays(-1) to $start = (Get-Date). AddDays(-30) and see what things alike. I want to be sure however that the value for MemMax is the highest value for a period of 24 hours. That is to say for the 07/05/2016 the given virtual machine never used a maximum of 18% of his memory attributed the 06/05/2016 the maximum amount of memory used was 36%, and so on that I extend on the date range.
Kind regards
Michael
It then becomes a rather simple Get-Stat script.
$vms = get - Vm | where {$_.} PowerState - eq "Receptor"}
$start = (get-Date). AddDays(-1)
$metrics = "mem.usage.average".
Get-Stat - entity $vms - start $start - Stat $metrics |
Select Timestamp,@{N='VM'; E={$_. @entity.name}}, Value |
Tri-objet-VM property |
Export-Csv "c:\
------ .csv '-noTypeInformation -
I am looking for 2 very simple scripts, we're for a specific cluster 1, I want to list all the VMS that have 4 GB of memory or more.
Then a 2nd script for a specific cluster1, want to list VM which do not have the VM tools installed or are out of date and select the name, the tool vmware status and memory.
Can someone help please
Here is a line that I tried on a single host... and must work if you connect on a VC as well... people it will list all virtual machines with more than 4 GB of memory:
Get - VM | Where-Object {$_.} MemoryMB - gt 4096}
If you want just the name and memory, then:
Get - VM | Where-Object {$_.} MemoryMB - gt 4096} | Select Name, MemoryMB
For the other for the VMtools...
Get-VM | Get-View | Select-Object @{N="Name";E={$_.Name}},@{Name="ToolsStatus";E={$_.Guest.ToolsStatus}}
Concerning
-
Need help with files combining script
Hey guys, I'm a graphic designer who is really hoping most commonly the code can someone help! I have several hundred images that need to be combined. A client gave me a folder of images and their alpha cards as separate files. I need combine each image and alpha map and export the new image format PNG 24 with transparency. Doing so by hand will take forever, do this with a script is going to be awesome. The script must:
-Open Filename.png
-Create a duplicate of the background layer (as background layers may not have masks it seems)
-Remove the background layer
-Add a layer mask to the new double layer
-Open filenamea.png (the alpha cards follow convention assignment of names + a .png file name)
-Copy filenamea.png into the layer mask to filename.png
-Save the filename.png for Web and devices such as a PNG 24 with transparency in a folder called converted (to avoid overwriting the old image)
I'm sure it's more complicated, it seems, but is - someone up to help a poor, illiterate code GD?
Here's a JavaScript solution only, for the curious. Save it as MergeAlpha.jsx and run it from Photoshop.
X
function cTID(s) { return app.charIDToTypeID(s); }; function sTID(s) { return app.stringIDToTypeID(s); }; function main() { var folder = Folder.selectDialog(); if (!folder) { return; } var ofolder = new Folder(folder + "/Converted"); ofolder.create(); var saveOpts = new ExportOptionsSaveForWeb(); saveOpts.format = SaveDocumentType.PNG; saveOpts.PNG8 = false; saveOpts.transparency = true; var pngs = folder.getFiles('*.png'); for (var i = 0; i < pngs.length; i++) { var file = pngs[i]; var afile = new File(folder + '/' + file.name.replace('.png', 'a.png')); if (!afile.exists) { continue; } var doc = app.open(file); doc.activeLayer.isBackgroundLayer = false; var adoc = app.open(afile); adoc.selection.selectAll(); adoc.selection.copy(); adoc.close(SaveOptions.DONOTSAVECHANGES); createLayerMask(); selectMaskChannel(); doc.paste(); var ofile = new File(ofolder + '/' + file.name); ofile.remove(); doc.exportDocument(ofile, ExportType.SAVEFORWEB, saveOpts); doc.close(SaveOptions.DONOTSAVECHANGES); } }; function createLayerMask() { var desc9 = new ActionDescriptor(); desc9.putClass( cTID('Nw '), cTID('Chnl') ); var ref6 = new ActionReference(); ref6.putEnumerated( cTID('Chnl'), cTID('Chnl'), cTID('Msk ') ); desc9.putReference( cTID('At '), ref6 ); desc9.putEnumerated( cTID('Usng'), cTID('UsrM'), cTID('RvlA') ); executeAction( cTID('Mk '), desc9, DialogModes.NO ); }; function selectMaskChannel() { var desc26 = new ActionDescriptor(); var ref18 = new ActionReference(); ref18.putEnumerated( cTID('Chnl'), cTID('Chnl'), cTID('Msk ') ); ref18.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt')); desc26.putReference( cTID('null'), ref18 ); desc26.putBoolean( cTID('MkVs'), true ); executeAction( cTID('slct'), desc26, DialogModes.NO ); }; main();
-
Hello
There some time, someone has written the following script for me. The idea was to make a command that would allow me to reduce an image up to 400 width in pixels without loss of scale. I want to have a similar command that will reduce a large image to 400 pilel height without loss of scale. I fiddled with the width command but cannot operate in height. Can I get help the following command to work at height of 400 pixels of rewriting? Thank you.
User variables
var width = 400;
Order
var dom = fw.getDocumentDOM ();
var scale = width/dom.width;
var height = dom.height * scale;
dom.setDocumentImageSize ({left:dom.left, top: dom.top, right:dom.left + width, bottom:dom.top + height}, {pixelsPerUnit:dom.resolution, United:dom.resolutionUnits});})
Tom Hersh wrote:
> I try it this way. But I couldn't make it work. The word "scale" is critical, but I switch did not help.Just pass the variables verbatim. Height width and width for
height.User variables
var width = 400;Order
var dom = fw.getDocumentDOM ();
var scale = width/dom.width;
var height = dom.height * scale;
dom.setDocumentImageSize ({left:dom.left, top: dom.top,
Right:DOM. Left + Width,
Bottom:DOM. Top + Height}, {pixelsPerUnit:dom.resolution,
:DOM.resolutionUnits}) units;User variables
var height = 400;Order
var dom = fw.getDocumentDOM ();
var scale = height/dom.height;
var width = dom.width * scale;
dom.setDocumentImageSize ({left:dom.left, top: dom.top,
Right:DOM. Left + Width,
Bottom:DOM. Top + Height}, {pixelsPerUnit:dom.resolution,
:DOM.resolutionUnits}) units;Once you see this script, it is not hard to see what he does.
This is the script of fireworks generated the scale just at the height of a
picture 400 px of 640 x 480 px.fw.getDocumentDOM)
.scaleSelection (0.83281248807907104, 0.83333333333333337,
"autoTrimImages transformAttributes");It works on all the images in 640 x 480. Add to that a 700 x 480 and it won't.
I'm assuming, very few people here (including me), would be able
to turn this into something that would take into account the widths of
as did senocular.SKB
-
Hello experts.
I have the following example stored procedure
create or replace procedure as bingo
Start
dbms_output.put_line ('Bingo!');
end;
Now, I would like to create more of them, but that giving different names
So I would like the following
create or replace procedure bingo_ 2 as
Start
dbms_output.put_line ('Bingo!');
end;
create or replace procedure bingo_3 as
Start
dbms_output.put_line ('Bingo!');
end;
I'm writing a dynamic statement to make, but I'm running into a bit of problem. Help, please. See my code below
Declare
XP varchar2 (4000);
GH varchar2 (4000);
Start
Select dbms_metadata.get_ddl ('PROCEDURE', 'BINGO', 'TEST_MFG') in xp
Double;
immediately run xp;
end;
The problem with my code so far, I'm having a time difficult obtaining the first line that contains the name so that I am change the name and it concatenates back to metadata.
Thank you.
Hello
If what you want is to create the BINGO_2 procedure the same as the procedure BINGO
Try the following
DECLARE
XP VARCHAR2 (4000);
GH VARCHAR2 (4000);
BEGIN
SELECT REPLACE (dbms_metadata.get_ddl ('PROCEDURE', 'BINGO', 'TEST_MFG'), 'BINGO', 'BINGO_2')
IN xp
DOUBLE;
EXECUTE immediate xp;
END;
/
concerning
Salim
-
help with bulk - update script vcloud Org
Hi all
I need to update the following script to edit only all VMs in a single body... I don't want to touch to all environments...
ForEach ($vm in (Get - VM)) {}
$vmv = get - VM $vm | Get-View
$name = $vmv. Name
$guestid = $vmv. Summary.Config.GuestId
$vmx = new-Object VMware.Vim.VirtualMachineConfigSpec
$vmx.extraConfig += new-Object VMware.Vim.OptionValue
$vmx.extraConfig [0] .key = "monitor_control.enable_softResetClearTSC."
$vmx.extraConfig [0] .value = 'TRUE '.
If ($guestid - like ' windows8 * Guest ') {}
($vmv). ReconfigVM_Task ($vmx)
}
}
When I connect to the specified by connect-ciserver-Server xxxx - Org Org MyOrg and test, it tells me:
Get - VM: 09/05/2016 15:40 Get - VM you are not currently connected
on all servers. Sign in first with a cmdlet Connect.
C:\scripts\TSCClear.ps1:1 char: 18
+ ForEach ($vm in (Get - VM)) {}
+ ~~~~~~
+ CategoryInfo: ResourceUnavailable: (:)) [Get - VM], ViServerConne)
ctionException
+ FullyQualifiedErrorId: Core_BaseCmdlet_NotConnectedError, VMware.VimAuto
mation.ViCore.Cmdlets.Commands.GetVM
Not a script guru here, just trying to see if I can make this work in an Org with some modifications
You get the error message because the cmdlet Get - VM work, you must be connected to a vCenter server. For the ReconfigVM_Task() method, you must be connected to a server vCenter as well. The following PowerCLI script connects to both a vCloud Director Server and vCenter server. The script uses the cmdlet Get-CIVM to recover virtual machines in the organization. Because the VirtualmachineConfigSpec is the same for each virtual machine, I took it out of the loop to make the script run faster.
$Organization = 'MyOrg ".
$CIServer = "vCloudDirectorServer".
$VIServer = "vCenterServer".
Connect-CIServer-Server $CIServer
SE connect-VIServer-Server $VIServer
$vmx = new-Object VMware.Vim.VirtualMachineConfigSpec
$vmx.extraConfig += new-Object VMware.Vim.OptionValue
$vmx.extraConfig [0] .key = "monitor_control.enable_softResetClearTSC."
$vmx.extraConfig [0] .value = 'TRUE '.
ForEach ($vmv in (Get-View - RelatedObject (Get-CIVM - Org $Organization). ExtensionData)) {}
$name = $vmv. Name
$guestid = $vmv. Summary.Config.GuestId
If ($guestid - like ' windows8 * Guest ') {}
($vmv). ReconfigVM_Task ($vmx)
}
}
-
Hi all
mattboren created the script below for a list of BIOS hardware version and firmware version:
## Script function: quickly get BIOS date, Smart Array FW version, and iLO FW version for HP hosts in a given location (folder, cluster, datacenter, etc.) ## Author: vNugglets.com -- Sep 2011 ## folder in which hosts in which we are interested reside #$strHostsFolderName = "myFolder" #Get-View -ViewType HostSystem -Property Name, Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo -SearchRoot (Get-View -ViewType Folder -Property Name -Filter @{"Name" = "^$([RegEx]::escape($strHostsFolderName))$"}).MoRef | %{ ## cluster in which hosts in which we are interested reside $strHostsClusterName = "Production" Get-View -ViewType HostSystem -Property Name, Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo -SearchRoot (Get-View -ViewType ClusterComputeResource -Property Name -Filter @{"Name" = "^$([RegEx]::escape($strHostsClusterName))$"}).MoRef | %{ $arrNumericSensorInfo = @($_.Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo) # HostNumericSensorInfo for BIOS, iLO, array controller $nsiBIOS = $arrNumericSensorInfo | ? {$_.Name -like "*System BIOS*"} $nsiArrayCtrlr = $arrNumericSensorInfo | ? {$_.Name -like "HP Smart Array Controller*"} $nsiILO = $arrNumericSensorInfo | ? {$_.Name -like "Hewlett-Packard BMC Firmware*"} $nsiNXdev = $arrNumericSensorInfo | ? {$_.Name -like "nx_nic device*"} $nsiNXdrv = $arrNumericSensorInfo | ? {$_.Name -like "nx_nic driver*"} if ( $nsiNXdev.Count -gt 0 ) { $nsiNXdevice = $nsiNXdev[0].Name } else { $nsiNXdevice = "n/a" } if ( $nsiNXdrv.Count -gt 0 ) { $nsiNXdriver = $nsiNXdrv[0].Name } else { $nsiNXdriver = "n/a" } New-Object PSObject -Property @{ VMHost = $_.Name "SystemBIOS" = $nsiBIOS.name "HPSmartArray" = $nsiArrayCtrlr.Name "iLOFirmware" = $nsiILO.Name "nx_nic device" = $nsiNXdevice "nx_nic driver" = $nsiNXdriver } ## end new-object } | Export-Csv C:\temp\Production-BLadeG7.csv ## end Foreach-Object
However, I would like to change the driver for the CARD and the version of the firmware but still appear.
Any kind of help and suggestions would be greatly appreciated.
Thank you.
Try like this
$strHostsClusterName = 'production '.
Get-view ViewType - HostSystem-Property Name, Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo - SearchRoot (Get-View - Name ClusterComputeResource-property - ViewType filter @{'Name' = ' ^ $([RegEx]: escape ($strHostsClusterName)) $"" "}). MoRef | %{
$arrNumericSensorInfo = @($_.) Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo)
# HostNumericSensorInfo for controller table of BIOS, ILO,
$nsiBIOS = $arrNumericSensorInfo |? {$_. {Name: like "* system BIOS *"}
$nsiArrayCtrlr = $arrNumericSensorInfo |? {$_. {Name - like "HP Smart Array Controller *"}
$nsiILO = $arrNumericSensorInfo |? {$_. {Name - like "Hewlett-Packard BMC Firmware *"}
$esxName = $_. Name
$esxcli = get-EsxCli - VMHost $_. Name
$esxcli.network.nic.list () | %{
$esxcli.network.nic.get ($_.) Name) | %{
$props [ordered] = @ {}
VMHost = $esxName
"SystemBIOS" = $nsiBIOS.name
"HPSmartArray" = $nsiArrayCtrlr.Name
"iLOFirmware" = $nsiILO.Name
"nx_nic device" = $_. Name
'nx_nic pilot' = $_. DriverInfo.Driver
"nx_nic driver version" = $_. DriverInfo.Version
"nx_nic firmware version" = $_. DriverInfo.FirmwareVersion
} # end new object
New-object PSObject-property $props
}
}
} | Export-Csv C:\temp\Production-BLadeG7.csv # end Foreach-Object
-
Need help with box counting Script
He had to count the number of boxes checked. I use the script below and its does not work. What I am, I am doing wrong? It drives me crazy.
/*
document level function to calculate the sum of the fields named
Function Sum (aFieldNames) {}
var sum = 0; sum of values
Browse fields
for (var i = 0; i < aFieldNames.length; i ++) {}
If (!) IsNaN (this.getField(aFieldNames[i]).value))
sum += Number (this.getField(aFieldNames[i]).value).
}
to return the sum;
} / / end of the sum function
*/
Bay of somme of domain names
var aCheckBox = new Array ("check Box5', 'Check Box8', 'Vérifier Box11', 'Check Box16', 'Check Box19', 'Check Box22', 'Check Box25', 'Check Box28', 'Check Box31', 'Check Box34', 'Check Box37', 'Check Box40', 'Check Box43', 'Check Box46', 'Check Box49', 'Check Box52', 'Check Box55', 'Check Box58', 'Check Box61', 'Check Box64', 'Check Box68'");
sum, named fields
Event.Value = Sum (aCheckBox);
Then why you check if they are several using the isNaN function and then try to add this number to the sum variable? Looks like you just copy the code, even if it does not apply to your situation.
Replace these two lines of code with this:
If (this.getField(aFieldNames[i]).value! = "Off") sum ++;
-
We do a manual Dr, and after disabling the replication process and presents the LUN DR ESX server and run a powershell script to save virtual machines, we want to turn on all with the script below.
It works, but I get 'this VM was copied or moved to issue a' for each I answer "moved" to. Any ideas on how to remove or to answer this question in an automated way?
$sourceVI = Read-Host "vCenter name.$creds = get-credentialto connect-viserver-Server $sourceVI - Credential $credsImport-Csv g:\dr\epicdrstartserverlist.csv | Foreach {Get - VM $_.} Name | {Start-vm-confirm: $false}Disconnect-VIServer $sourceVI - confirm: $False(the CSV file is just a list of the names of virtual machine I want to turn on).You can check the presence of an issue with the cmdlet Get-VMQuestion het and reply with the Set-VMQuestion cmdlet.
-
I need help with my first Script in AE CS5
Hello fellow designers out there.
I'm newbie on AE Scripting here. I run my CS 5 on Win 7. I'm trying to create a simple solid GUI and it controls opacity by cursor. I fail and do not now how it work. Here is the code that I have written in reference to many sources and tutorials:
myComp = app.project.item (1); akses comp 1
mySolid = myComp.layers.addSolid ([1.0,1.0,0], 'my place', 50, 50, 1); solid
var myWin = new window ("palette", "Transform", undefined); create the palette
myWin.orientation = "row";
var myOpacity = myWin.add ('Committee', undefined, "Strong opacity");
myOpacity.orientation = "column";
myOpacity.add ("statictext", undefined, "Opacity Kontrol");
var opacitysliderCtrl = myOpacity.add ("slider", undefined, 50, 0, 100); make cursor
var layerOpacity = mySolid.property ("opacity");
opacitysliderCtrl.onChanging = function()
{
var val = Math.round (opacitysliderCtrl.value);
layerOpacity.value = val;
};
myWin.center ();
myWin.show ();
Please, help me to see the problem here. Thank you
There is more harm than good in your work
At the moment you script attached a slider to a single layer (mySolid, that you add at the beginning).
This is not very useful, that you cannot use this slider for the other layers.
You should also keep in mind that this solid can be deleted, so the mySolid object may become invalid (referring to a solid that no longer exists).
I don't know what, exactly, is your plan, but a script has generally not set anything related to AE in his many body (at launch).
Only when the user clicks/change a widget script tries to extract a model, layer, property, or anything that the user specified by "a kind of secret code" (most of the time: the model, property, layer, etc. is selected).
If you want the slider to control the opacity value of all selected layers in the active model, it would be something like this:
var myWin = new Window("palette", "Transform", undefined); //create pallete myWin.orientation = "row"; var myOpacity = myWin.add("panel", undefined, "Solid Opacity"); myOpacity.orientation = "column"; myOpacity.add("statictext", undefined, "Kontrol Opacity"); var opacitysliderCtrl = myOpacity.add("slider", undefined, 50, 0, 100);//make slider opacitysliderCtrl.onChanging = function onOpacitySliderChanging(){ // retrieve the AE things that have to be handled: in this case, all selected layers in the active comp var myComp, myLayer, n; var layerOpacity, val; myComp = app.project.activeItem; if (myComp.numLayers>0){ for (n=0; n
Xavier
-
Need help with vSphere data script, packaging and sending it to the data warehouse
Greetings PowerCLI gurus.
Everyone can offer suggestions on a script which can query vSphere and pull on the following fields of the virtual computer:Name State Status Host Space in use Space used Format in a file in the CSV format and send the file to an FTP server?
Much respect to all, thanks a lot in advance.
Hello-
Happy to help you.
OK, well, if this database is accessible through a UNC path, you might make a copy directly using Copy-Item. If you use different credentials, you can encrypt and store in an XML file. HAL Rottenberg wrote to do http://halr9000.com/article/531.
Or, if this pension data is something that supports the secure copy (scp) or secure FTP (SFTP), those who would be good options. Again, you can store the alternative credentials in an encrypted in an XML file format and use them as needed.
Certainly, there is a balance to be struck between security and ease of use. It may be such that the transmitted data are not considered sensitive to all, and clear data transfers are acceptable. Probably still a good idea to take measures to protect the credentials at least.
Maybe you are looking for
-
Links in search results does not open new tabs.
I'm missing something here and in other threads on this topic. I used to be able to search in the google search bar, for example, and a new tab opens with the search results. So if I left clicked on a link in the search results another new tab open a
-
BIOS WMI question - how to disable a specific device in the boot list?
Hello I have question for WMI, how to disable a specific device in the boot list? I found "BootODD" "BootFDD" etc. in the documentation, but I have no idea how to use. And here my question. Documentation:http://APS2.toshiba-tro.de/KB0/TSB3803HR0000R0
-
How to remove windows xp and re - install windows xp?
My RSP service is disabled
-
HO to add a scroll bar on RichTextField
Hello I developed an application where I use this type of popupScreen. Here I put the image, width height to the RTF, field I want to put vertical scrolling, for the following is the code for this:- txtNote_value = new RichTextField(){protected void
-
Windows 7 no sound after you have unlocked the PC
I have Windows 7 Professional SP 1, running on a ThinkPad: Lenovo's laptop. No matter when I manually lock the PC (with Windows + L) or the screen saver times out and locks the PC, after you have unlocked the PC no sounds work, at all. I checked de