I have some problem with querying the Win32_PnPSignedDriver.
Here is the code that i use to querying the PnPSignedDriver properties.
string query = "Select * from Win32_PnPSignedDriver";
tbLog.Clear();
ManagementObjectSearcher objSearcher = new ManagementObjectSearcher( "root\\CIMV2", query );
ManagementObjectCollection objCollection = objSearcher.Get();
var managementObject = objCollection.OfType<ManagementObject>().FirstOrDefault();
PropertyDataCollection props = managementObject.Properties;
foreach ( PropertyData prop in props )
{
tbLog.AppendText( String.Format( "Property name: {0}\r\n", prop.Name ) );
}
When I run the query on my computer, the result is:
Property name: Caption
Property name: ClassGuid
Property name: CompatID
Property name: CreationClassName
Property name: Description
Property name: DeviceClass
Property name: DeviceID
Property name: DeviceName
Property name: DevLoader
Property name: DriverDate
Property name: DriverName
Property name: DriverProviderName
Property name: DriverVersion
Property name: FriendlyName
Property name: HardWareID
Property name: InfName
Property name: InstallDate
Property name: IsSigned
Property name: Location
Property name: Manufacturer
Property name: Name
Property name: PDO
Property name: Signer
Property name: Started
Property name: StartMode
Property name: Status
Property name: SystemCreationClassName
Property name: SystemName
But when i ran the same code on the production machine the result is:
Property name: DriverDate Property name: DriverDesc
Property name: DriverVersion Property name: Index Property
name: ProviderName
Does anyone know why I have 2 different results?
Does this means that the WMI is corrupt and I need to rebuild the WMI on the production machine?
Thanks,
Fitriadi
Related
I'm trying to get the Spring Profile Arbiter working. According to the documentation you can place an arbiter almost anywhere:
So an Arbiter could encapsulate something as simple as a single property declaration or a whole set of Appenders or Loggers.
Unfortunately, the documentation doesn't provide any example code how this can be done in modern yaml-config files. This is what I have at the moment:
Configuration:
name: Default
//...
Properties:
Property:
- name: log-dir
value: "./logs"
- name: log-file-name
value: "logfile"
- name: log-file-ext
value: "log"
- name: connection-factory-method
value: "getDbConnection"
SpringProfile:
name: development
- name: connection-factory-method
value: "getDbConnection4dev"
- name: con-pattern-logger
value: "%-50.50c{1.}"
//...
Sadly, not working as expected. Played for a while, but couldn't find a working solution. All I get are initialization errors.
I am grateful for any information that could help me get ahead.
In your configuration each YAML object represents a Log4j2 component.
The type of object (short plugin name) to instantiate must be provided as type property of the YAML object. If no such property exist, the key associated to the object is used.
To define a SpringProfileArbiter component that contains a Property component you can either use:
key1:
type: SpringProfile
name: development
property1:
type: Property
name: connection-factory-method
value: "getDbConnection4dev"
or
SpringProfile:
name: development
Property:
name: connection-factory-method
value: "getDbConnection4dev"
You can use arrays if you want to define multiple components of the same type.
Remark: if your application runs under the "development" profile, the "connection-factory-method" property will be defined twice. To prevent this you can use SelectArbiter and DefaultArbiter to provide the equivalent of an if ... else clause:
Select:
SpringProfile:
name: development
Property:
name: connection-factory-method
value: "getDbConnection4dev"
DefaultArbiter:
Property:
name: connection-factory-method
value: "getDbConnection"
I'm assigned to a filebeat plugin of our product. I wrote a IngestPipeline and de default mapping is in various ways unfortunately so i wanted to change this with the _meta/fields.yml.
I configured the yml file accordingly to:
https://www.elastic.co/guide/en/beats/devguide/7.8/filebeat-modules-devguide.html#_metafields_yml_2
https://www.elastic.co/guide/en/beats/devguide/current/event-fields-yml.html
https://github.com/elastic/kibana/issues/82273
My yml file looks like this:
- key: pac
title: "pac"
description: Description missing
pac Module
fields:
- name: pac.log
type: group
description: Description missing
fields:
- name: deo
type: group
description: Description missing
fields:
- name: duration
type: long
description: Duration of the deo
- name: category
type: keyword
description: Category of the deo
- name: owner
type: keyword
description: User of the deo
- name: version
type: float
description: Version of the deo
- name: name
type: keyword
description: Name of the deo
- name: reference
type: double
description: Referencenumber of the deo
- name: state
type: keyword
description: State of the deo
- name: status
type: keyword
description: Status of the deo
- name: trigger
type: group
description: Description missing
fields:
- name: category
type: keyword
description: Category of the deo-trigger
- name: name
type: text
description: Name of the deo-trigger
- name: path
type: text
description: Full-Text of the trigger properties
- name: provider
type: keyword
description: Supplier of the deo-trigger
- name: wiring
type: group
description: Description missing
fields:
- name: async
type: boolean
description: If deos wired asynchronously
- name: deoId
type: keyword
description: Identification number of the deo
- name: execute
type: boolean
description: If deo is executed or not
- name: owner
type: keyword
description: User of the deo
- name: shared
type: boolean
description: Deo was shared
- name: stopOnError
type: boolean
description: If deo stopped on Error
- name: do
type: group
description: Description missing
fields:
- name: name
type: keyword
description: Name of the do task
- name: state
type: group
description: Description missing
fields:
- name: from
type: keyword
description: State from which the do task was used
- name: to
type: keyword
description: State to which the do task was switched
- name: esa
type: group
description: Description missing
fields:
- name: connection
type: keyword
description: Connection status of the ESA
- name: name
type: keyword
description: Name of the ESA
- name: state
type: group
description: Description missing
fields:
- name: from
type: keyword
description: State from which the ESA Connection was established
- name: to
type: keyword
description: State to which the ESA Connection was established
- name: monitor
type: group
description: Description missing
fields:
- name: heap
type: group
description: Description missing
fields:
- name: bytes
type: long
description: Used bytes of the heap
- name: pct
type: float
description: Percentage of the maximum available bytes
- name: heapgc
type: group
description: Description missing
fields:
- name: bytes
type: long
description: Used bytes of the heapgc
- name: pct
type: float
description: Percentage of the maximum available bytes
- name: service
type: group
description: Description missing
fields:
- name: class
type: keyword
description: Class of the service
- name: duration
type: long
description: How long the service call took
- name: name
type: keyword
description: Name of the service call
- name: operation
type: keyword
description: Operation type of the service call
- name: success
type: boolean
description: Was the service call successfull or not
- name: system
type: group
description: Description missing
fields:
- name: category
type: keyword
description: Category of the System
- name: priority
type: keyword
description: Priority of the System
- name: monitor
type: group
description: Description missing
fields:
- name: cpu
type: group
description: Description missing
fields:
- name: pct
type: float
description: Percentage of the cpu usage
- name: wiring
type: text
description: Description missing
- name: meta
type: text
description: Description missing
- name: tags
type: keyword
description: Description missing
- name: timestamp
type: date
description: Description missing
- name: level
type: keyword
description: Description missing
- name: logger
type: keyword
description: Description missing
I would like to have the field types as configured in the fields.yml file. But at first no mapping is available and if i start to send logs the mapping for my fields is created automatically with unfortunate types.
The yaml file works as it is in the description above. My Problem was that my collegue from whom i inherited the project didn't use the filebeat build script. So the uploaded fields.yml file wasn't extended by my fields. I reconfigured the fields.yaml path inside the filebeat.yml configuration file and now it works.
I have $Node.NodeName, $Node.Environment, $Node.Role defined in the following DSC config file. They don't appear to expand to the correct values in the MOF file and instead shows:
HOSTNAME: System.Collections.Hashtable
env: System.Collections.Hashtable
role: System.Collections.Hashtable
I was expecting each one to expand to the corresponding value as defined under AllNodes. $SQLUser and $SQLPassword display the correct passed in values.
CreateDBFile -SQLUser "myuser" -SQLPassword "mypassword" -ConfigurationData inventory.psd1 -OutputPath "C:\DSC"
inventory.psd1
#{
AllNodes = #(
#{
NodeName = "QA-WEB01"
NodeIP = "10.48.200.19"
Role = "web"
Environment = "QA"
},
#{
NodeName = "QA-WEB02"
NodeIP = "10.48.200.20"
Role = "Web"
Environment = "UAT"
}
)
}
CreateDBFile.ps1
Configuration CreateDBFile
{
param(
[String]$SQLUser,
[String]$SQLPassword
)
Node $AllNodes.Where{$_.Role -contains "web" -and $_.NodeIP -contains "10.48.200.19"}.NodeName
{
File FileExample
{
Ensure = 'Present'
Contents = "integrations:
- name: nri-mssql
env:
HOSTNAME: $Node.NodeName
USERNAME: $SQLUser
PASSWORD: $SQLPassword
PORT: 1433
ENABLE_SSL: false
TRUST_SERVER_CERTIFICATE: true
TIMEOUT: 15
interval: 15s
labels:
env: $Node.Environment
role: $Node.Role
inventory_source: config/mssql"
DestinationPath = 'D:\Logs\\mssql-config.yml'
Type = 'File'
}
}
}
Here is the working CreateDBFile.ps1 file:
Configuration CreateDBFile
{
param(
[String]$SQLUser,
[String]$SQLPassword
)
Node $AllNodes.Where{$_.Role -contains "web" -and $_.NodeIP -contains "10.48.200.19"}.NodeName
{
File FileExample
{
Ensure = 'Present'
Contents = "integrations:
- name: nri-mssql
env:
HOSTNAME: $($Node.NodeName)
USERNAME: $SQLUser
PASSWORD: $SQLPassword
PORT: 1433
ENABLE_SSL: false
TRUST_SERVER_CERTIFICATE: true
TIMEOUT: 15
interval: 15s
labels:
env: $($Node.Environment)
role: $($Node.Role)
inventory_source: config/mssql"
DestinationPath = 'D:\Logs\\mssql-config.yml'
Type = 'File'
}
}
}
I am trying to create a SNS alarm for my EMR cluster so when EMR cluster is failed i should get notified .
But my issue is i am not able to pass Cluster ID as JobFlowId in the CloudWatch Alarm .
I am create all resources using CloudFomartion Templet .
When i use REF to refer Cluster Id i get below error .
Error
Template validation error: Template format error: Unresolved resource dependencies [FinancialLineItemEmrCluster] in the Resources block of the template
Here is my templet .
I am having issue specially in at JobFlowId while creating the resources EMRAlarm
AWSTemplateFormatVersion: '2010-09-09'
Description: TRF SDI Optmization Full File Creation
Parameters:
AppName:
Default: trfsdioptmization
Description: trfsdioptmization.
Type: String
Environment:
Type: String
Default: nonprod
FinancialIdentifier:
Type: String
Default: 123456789
ApplicationAssetInsightId:
Type: String
Default: 12345678
EnvironmentType:
Type: String
AllowedValues:
- "prod"
- "PRE-PRODUCTION"
- "QUALITY ASSURANCE"
- "nonprod"
Default: nonprod
ResourceOwner:
Type: String
Default: sudarshan.kumar#abcd.com
EnvironmentPhase:
Type: String
Default: nonprod
RegionAbbreviation:
Default: us-east-1
Description: Region Abbreviation e.g. us-east-1 for us-east
Type: String
Resources:
TRFSDIFullfileGeneration:
Type: "AWS::DataPipeline::Pipeline"
#DeletionPolicy: Retain
Properties:
Name: !Sub "${ApplicationAssetInsightId}-tr-fr-${EnvironmentPhase}-${RegionAbbreviation}-${AppName}-DataPipeline"
Description: "Pipeline to create full file for TRFSDI full file Optmization"
Activate: false
PipelineObjects:
-
Id: "FinancialLineItemActivity"
Name: "FinancialLineItemActivity"
Fields:
-
Key: "type"
StringValue: "EmrActivity"
-
Key: "runsOn"
RefValue: "FinancialLineItemEmrCluster"
-
Key: "step"
StringValue: "command-runner.jar,spark-submit,--master,yarn-cluster,--deploy-mode,cluster,--class,start.EntryFileCreation,s3://205147-trf-fr-nonprdo-us-east-1-trfsdioptmization/AJAR/SparkJob-0.1-jar-with-dependencies.jar,FinancialLineItem"
Id: "Default"
Name: "Default"
Fields:
-
Key: "type"
StringValue: "Default"
-
Key: "scheduleType"
StringValue: "ONDEMAND"
-
Key: "failureAndRerunMode"
StringValue: "CASCADE"
-
Key: "role"
StringValue: "DataPipelineDefaultRole"
-
Key: "resourceRole"
StringValue: "DataPipelineDefaultResourceRole"
-
Key: "pipelineLogUri"
StringValue: "s3://205147-tr-fr-nonprod-us-east-1-trfsdioptmization/EMRLOGS"
-
Id: "FinancialLineItemEmrCluster"
Name: "FinancialLineItemEmrCluster"
Fields:
-
Key: "terminateAfter"
StringValue: "30 Minutes"
-
Key: "releaseLabel"
StringValue: "emr-5.9.0"
-
Key: "masterInstanceType"
StringValue: "m3.xlarge"
-
Key: "coreInstanceType"
StringValue: "m3.2xlarge"
-
Key: "coreInstanceCount"
StringValue: "2"
-
Key: "type"
StringValue: "EmrCluster"
-
Key: "applications"
StringValue: "spark"
-
Key: "subnetId"
StringValue: "subnet-86febcab"
-
Key: "onSuccess"
RefValue: "FinancialLineItem_Success"
-
Key: "onFail"
RefValue: "FinancialLineItem_Fail"
EMRAlarm:
Type: AWS::CloudWatch::Alarm
Properties:
AlarmDescription: "Raise alarm if apps running on EMR cluster is killed"
Namespace: AWS/ElasticMapReduce
MetricName: AppsKilled
Dimensions:
- Name: 205147-TRFSDIOPTmization
JobFlowId: !Ref FinancialLineItemEmrCluster
Statistic: Average
Period: 15
EvaluationPeriods: '1'
ComparisonOperator: GreaterThanOrEqualToThreshold
Threshold: 1
AlarmActions:
- "AWSTRF_HEALTH"
There is no resource of the type AWS::EMR::Cluster in your template.
You are referencing something called FinancialLineItemEmrCluster in your CloudWatch Alarm. From the context, I am assuming you are trying to reference a EMR job. However, since you have no parameter or resource in your template named FinancialLineItemEmrCluster, you can not access is.
EMR cluster IDs generally look like this: j-1ABCD123AB1A. You have several options:
If this cluster is in another template, you could create a CloudFormation export in that stack, and use !ImportValue in your template to import it.
Alternatively, you could use a Parameter in your template and pass the ClusterId that way. Add this as a parameter:
Example:
FinancialLineItemEmrCluster:
Description: 'Your EMR cluster id. Example: j-1ABCD123AB1A'
Type: String
A third alternative is to just hardcode it into your template.
In any case, you can not refer directly to a resource in another stack.
If you have not createt an EMR::Cluster at all, and have no Cluster Id, you need to create one first. You could add one to your Template using the AWS::EMR::Cluster resource:
FinancialLineItemEmrCluster:
Type: AWS::EMR::Cluster
Properties:
Instances:
MasterInstanceGroup:
InstanceCount: 1
InstanceType: "m3.xlarge"
Market: "ON_DEMAND"
Name: "Master"
CoreInstanceGroup:
InstanceCount: 2
InstanceType: "m3.xlarge"
Market: "ON_DEMAND"
Name: "Core"
TerminationProtected: true
Name: "TestCluster"
JobFlowRole: "EMR_EC2_DefaultRole"
ServiceRole: "EMR_DefaultRole"
ReleaseLabel: "emr-4.2.0"
Cannot create a google deployment manager runtime config variable
resources:
- name: star-config
type: runtimeconfig.v1beta1.config
properties:
name: star-config
- name: igurl_variable
type: runtimeconfig.v1beta1.variable
properties:
name: igurl_variable
value: 'trek'
parent: $(ref.star-config.name)
I checked the logs and I see that the status is set to bad_request when I create the above deployment.
Audit log
status: {
message: "BAD_REQUEST"
}
What could be the reason for the error ?
You should try the with the properties fields as in the official documentation for both the config and variable resources.
The resource file should be something like:
resources:
- name: star-config
type: runtimeconfig.v1beta1.config
properties:
config: star-config
- name: igurl_variable
type: runtimeconfig.v1beta1.variable
properties:
variable: igurl_variable
text: 'trek'
parent: $(ref.star-config.name)