I want to automatically renew SSL certificates provided by let's encrypt.
Here's my plan:
Use crontab to execute certbot renew everyday.
If there's any certificate renewed by certbot renew, use AWS CLI to upload the certificate to a load balancer. (AWS China doesn't have Certificate Manager yet, that's why I use let's encrypt.)
My problem is that I don't know how to detect if there's any certificate renewed by certbot renew command.
This command returns something like the following:
*** renew ***
Saving debug log to /var/log/letsencrypt/letsencrypt.log
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/ooo.com-0001.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not yet due for renewal
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/xxx.com-0002.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not yet due for renewal
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The following certs are not due for renewal yet:
/etc/letsencrypt/live/ooo.com-0001/fullchain.pem expires on 2019-12-25 (skipped)
/etc/letsencrypt/live/xxx.com-0002/fullchain.pem expires on 2019-12-25 (skipped)
No renewals were attempted.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
same
I think it would be difficult to parse the string to decide if there's any renewed certificates.
Related
I create a .golangci.yml in working directory, which have more linters than default, and run golangci-lint run -v but found linters are still default value, anyone encountered same issue? I have checked .golangci.yml path is correct. below is our configure value:
linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- exhaustive
- gochecknoinits
- goconst
- gocritic
- gofmt
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- misspell
- nakedret
- noctx
This yaml file isn't indented properly. try:
linters:
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- exhaustive
- gochecknoinits
- goconst
- gocritic
- gofmt
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- misspell
- nakedret
- noctx
I want to add the line "*{My-Dept$2}" in file.yaml after *{My-Dept$1} this on every finding, I was able to find a line that starts with *{My-Dept$1} and inserted only one time, and ended with this trouble.
I have this in Multiple lines in the file and wanted to insert after "*{My-Dept$1}".
The reference are below:
Infrastructure:
- *{My-Dept$0}
- *{My-Dept$1}
Applications:
- *{My-Dept$1}
- *{My-Dept$3}
- *{My-Dept$4}
Database:
- *{My-Dept$0}
- *{My-Dept$1}
- *{My-Dept$3}
With the below code i was able to add the line "- *{My-Dept$2}" after only in the last "Database arry " entry.
- name: Add missing Dept
lineinfile:
dest: ./file.yaml
insertafter: '[*{]My-Dept[$]1[}]' #
line: ' - *{My-Dept$2}'
and the Output:
Infrastructure:
- *{My-Dept$0}
- *{My-Dept$1}
Applications:
- *{My-Dept$1}
- *{My-Dept$3}
- *{My-Dept$4}
Database:
- *{My-Dept$0}
- *{My-Dept$1}
- *{My-Dept$2}
- *{My-Dept$3}
I wish to get "*{My-Dept$2}" on every next line of each of the findings of *{My-Dept$1} entries. Most of the search find talks about replace, but my requirement is to insert multiple times on each finding.
Make the file.yaml valid YAML. For example
shell> cat file.yaml
---
Infrastructure:
- '*{My-Dept$0}'
- '*{My-Dept$1}'
Applications:
- '*{My-Dept$1}'
- '*{My-Dept$3}'
- '*{My-Dept$4}'
Database:
- '*{My-Dept$0}'
- '*{My-Dept$1}'
- '*{My-Dept$3}'
Q: "Put *{My-Dept$2} on every next line of each of the findings of *{My-Dept$1} entries."
A: It's possible to edit the file on your own.
Read the variables from the file into a dictionary. For examle
- include_vars:
file: file.yaml
name: my_dict
- debug:
var: my_dict
gives
my_dict:
Applications:
- '*{My-Dept$1}'
- '*{My-Dept$3}'
- '*{My-Dept$4}'
Database:
- '*{My-Dept$0}'
- '*{My-Dept$1}'
- '*{My-Dept$3}'
Infrastructure:
- '*{My-Dept$0}'
- '*{My-Dept$1}'
Modify the data. For example
- set_fact:
my_dict1: "{{ my_dict1|default({})|
combine({item: (my_dict[item] + add_items)|unique|sort}) }}"
loop: "{{ my_dict.keys()|list }}"
vars:
add_items:
- '*{My-Dept$2}'
- debug:
var: my_dict1
gives
my_dict1:
Applications:
- '*{My-Dept$1}'
- '*{My-Dept$2}'
- '*{My-Dept$3}'
- '*{My-Dept$4}'
Database:
- '*{My-Dept$0}'
- '*{My-Dept$1}'
- '*{My-Dept$2}'
- '*{My-Dept$3}'
Infrastructure:
- '*{My-Dept$0}'
- '*{My-Dept$1}'
- '*{My-Dept$2}'
Create template
shelll> cat file.yaml.j2
---
{% for k,v in my_dict1.items() %}
{{ k }}:
{% for item in v %}
- '{{ item }}'
{% endfor %}
{% endfor %}
Write the modified data into the file
- template:
src: file.yaml.j2
dest: file.yaml
gives
shell> cat file.yaml
---
Infrastructure:
- '*{My-Dept$0}'
- '*{My-Dept$1}'
- '*{My-Dept$2}'
Applications:
- '*{My-Dept$1}'
- '*{My-Dept$2}'
- '*{My-Dept$3}'
- '*{My-Dept$4}'
Database:
- '*{My-Dept$0}'
- '*{My-Dept$1}'
- '*{My-Dept$2}'
- '*{My-Dept$3}'
I am trying to setup a 3 node cluster (nimbus/supervisor/supervisor), but my conf/storm.yaml file cannot be parsed when running bin/storm nimbus.
conf/storm.yaml:
storm.zookeeper.servers:
- "192.168.1.202"
- "192.168.1.203"
- "192.168.1.204"
storm.local.dir: "/opt/storm-1.2.1”
nimbus.seeds: ["192.168.1.202"]
supervisor.slots.ports:
- 6700
- 6701
- 6702
- 6703
storm.health.check.dir: "healthchecks"
storm.health.check.timeout.ms: 5000
You have a special quotation mark at the end of
storm.local.dir: "/opt/storm-1.2.1”
You can validate your yaml with e.g. http://yaml-online-parser.appspot.com/
I have integrated NIFI OPC UA [https://github.com/wadesalazar/NIFI-OPCUA] processor with Apache Nifi 1.3.I am following this URL [https://community.hortonworks.com/articles/90355/collect-data-from-opc-ua-protocol.html] to get started. I have installed a simulation OPC server from prosys opc ua on windows.
I am able to pull messages from the GetNodeIDs processor on NIFI, and splitText processor is being used for reading messages line by line and sending to GetValue processor as shown in the example, but my GetValue processor is continuously throwing below error.
I tried to set "starting node" property in GetNodeIDs processor, but not able to make out what a node property should I set, please find below my sample data from simulation server.
Sample data received from simulation opc server:
nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=85
- nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2253
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2004
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2007
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2009
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2010
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2011
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2012
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11489
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11527
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2006
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2742
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2005
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2008
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2256
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2138
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2257
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2258
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2259
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2260
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2992
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2993
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2268
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2013
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2996
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2997
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11192
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11704
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2271
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2272
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2736
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2269
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2737
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=3704
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11703
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2735
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11702
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2274
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2020
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2275
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2290
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=3706
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2294
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2295
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2033
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2296
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2034
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=3709
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11313
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11314
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11312
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11492
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11493
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11494
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11715
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=11645
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=12637
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=12581
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=12642
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=12672
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=12675
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=12641
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=12710
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=12639
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=12640
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=12711
- - ns=2;s=MyObjectsFolder
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - - ns=2;s=MyDevice
- - - ns=2;s=MyDevice
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2255
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=68
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2994
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=68
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2254
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=68
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=2267
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=68
- ns=2;s=MyObjectsFolder
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - ns=2;s=MyDevice
- - - ns=2;s=MyDeviceType
- - - ns=2;s=MyEnumObject
- - - ns=2;s=MyLevel
- - - ns=2;s=MyLevel
- - - ns=2;s=MyLevel.Alarm
- - - ns=2;s=MyMethod
- - - ns=2;s=MySwitch
- - ns=2;s=MyDevice
- - - ns=2;s=MyDeviceType
- - - ns=2;s=MyEnumObject
- - - ns=2;s=MyLevel
- - - ns=2;s=MyLevel
- - - ns=2;s=MyLevel.Alarm
- - - ns=2;s=MyMethod
- - - ns=2;s=MySwitch
- ns=3;s=StaticData
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - ns=3;s=AccessLevels
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - - ns=3;s=AccessLevelCurrentRead
- - - ns=3;s=AccessLevelCurrentReadNotUser
- - - ns=3;s=AccessLevelCurrentReadWrite
- - - ns=3;s=AccessLevelCurrentWrite
- - - ns=3;s=AccessLevelCurrentWriteNotUser
- - ns=3;s=AnalogItemArrays
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - - ns=3;s=ByteAnalogItemArray
- - - ns=3;s=DoubleAnalogItemArray
- - - ns=3;s=FloatAnalogItemArray
- - - ns=3;s=Int16AnalogItemArray
- - - ns=3;s=Int32AnalogItemArray
- - - ns=3;s=Int64AnalogItemArray
- - - ns=3;s=SByteAnalogItemArray
- - - ns=3;s=UInt16AnalogItemArray
- - - ns=3;s=UInt32AnalogItemArray
- - - ns=3;s=UInt64AnalogItemArray
- - ns=3;s=AnalogItems
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - - ns=3;s=ByteAnalogItem
- - - ns=3;s=DoubleAnalogItem
- - - ns=3;s=FloatAnalogItem
- - - ns=3;s=Int16AnalogItem
- - - ns=3;s=Int32AnalogItem
- - - ns=3;s=Int64AnalogItem
- - - ns=3;s=SByteAnalogItem
- - - ns=3;s=Sample Instrument Int32AnalogItem
- - - ns=3;s=UInt16AnalogItem
- - - ns=3;s=UInt32AnalogItem
- - - ns=3;s=UInt64AnalogItem
- - ns=3;s=DataItems
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - - ns=3;s=BooleanDataItem
- - - ns=3;s=ByteDataItem
- - - ns=3;s=ByteStringDataItem
- - - ns=3;s=DateTimeDataItem
- - - ns=3;s=DoubleDataItem
- - - ns=3;s=FloatDataItem
- - - ns=3;s=GUIDDataItem
- - - ns=3;s=Int16DataItem
- - - ns=3;s=Int32DataItem
- - - ns=3;s=Int64DataItem
- - - ns=3;s=SByteDataItem
- - - ns=3;s=StringDataItem
- - - ns=3;s=UInt16DataItem
- - - ns=3;s=UInt32DataItem
- - - ns=3;s=UInt64DataItem
- - - ns=3;s=XmlElementDataItem
- - ns=3;s=DeepFolder
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - - ns=3;s=DeepObject01
- - ns=3;s=MultiStateItems
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - - ns=3;s=MultiStateDiscreteItem
- - ns=3;s=StaticArrayVariables
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - - ns=3;s=BooleanArray
- - - ns=3;s=ByteArray
- - - ns=3;s=ByteStringArray
- - - ns=3;s=DateTimeArray
- - - ns=3;s=DoubleArray
- - - ns=3;s=FloatArray
- - - ns=3;s=GUIDArrayArray
- - - ns=3;s=Int16Array
- - - ns=3;s=Int32Array
- - - ns=3;s=Int64Array
- - - ns=3;s=LocalizedTextArray
- - - ns=3;s=QualifiedNameArray
- - - ns=3;s=SByteArray
- - - ns=3;s=StringArray
- - - ns=3;s=UInt16Array
- - - ns=3;s=UInt32Array
- - - ns=3;s=UInt64Array
- - - ns=3;s=VariantArray
- - - ns=3;s=XmlElementArray
- - ns=3;s=StaticVariables
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - - ns=3;s=Boolean
- - - ns=3;s=Byte
- - - ns=3;s=ByteString
- - - ns=3;s=DateTime
- - - ns=3;s=Double
- - - ns=3;s=Duration
- - - ns=3;s=Enumeration
- - - ns=3;s=Float
- - - ns=3;s=GUID
- - - ns=3;s=Image
- - - ns=3;s=ImageBMP
- - - ns=3;s=ImageGIF
- - - ns=3;s=ImageJPG
- - - ns=3;s=ImagePNG
- - - ns=3;s=Int16
- - - ns=3;s=Int32
- - - ns=3;s=Int64
- - - ns=3;s=Integer
- - - ns=3;s=LocaleId
- - - ns=3;s=LocalizedText
- - - ns=3;s=NodeId
- - - ns=3;s=Number
- - - ns=3;s=QualifiedName
- - - ns=3;s=SByte
- - - ns=3;s=String
- - - ns=3;s=Time
- - - ns=3;s=UInt16
- - - ns=3;s=UInt32
- - - ns=3;s=UInt64
- - - ns=3;s=UInteger
- - - ns=3;s=UtcTime
- - - ns=3;s=Variant
- - - ns=3;s=XmlElement
- - ns=3;s=TwoStateItems
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - - ns=3;s=TwoStateDiscreteItem
- ns=4;s=NonUaNodeComplianceTest
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - ns=4;s=ByteString
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=SByte
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Time
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=String
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Int16
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Image
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=DateTime
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=LocalizedText
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=UtcTime
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=LocaleId
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=ImageGIF
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Number
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Int32
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=ImageBMP
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=UInteger
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Boolean
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=UInt64
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Enumeration
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=QualifiedName
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=GUID
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Duration
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Double
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Variant
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Integer
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Float
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=ImagePNG
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Int64
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=Byte
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=NodeId
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=XmlElement
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=UInt16
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=ImageJPG
- - - ns=4;s=NonUaNodeDataItemType
- - ns=4;s=UInt32
- - - ns=4;s=NonUaNodeDataItemType
- ns=5;s=85/0:Simulation
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - ns=5;s=Counter1
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=63
- - ns=5;s=Expression1
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=63
- - ns=5;s=Random1
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=63
- - ns=5;s=Sawtooth1
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=63
- - ns=5;s=SimulationServerNode11
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=63
- - ns=5;s=Sinusoid1
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=63
- - ns=5;s=Square1
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=63
- - ns=5;s=Triangle1
- - - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=63
- ns=6;s=MyBigNodeManager
- - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=61
- - ns=6;s=DataItem_0000
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0001
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0002
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0003
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0004
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0005
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0006
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0007
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0008
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0009
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0010
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0011
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0012
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0013
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0014
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0015
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0016
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0017
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0018
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0019
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0020
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0021
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0022
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0023
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0024
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0025
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0026
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0027
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0028
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0029
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0030
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0031
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0032
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0033
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0034
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0035
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0036
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0037
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0038
- - - ns=6;s=DataItemType
- - ns=6;s=DataItem_0039
- - - ns=6;s=DataItemType
Exception:
2017-07-25 18:03:10,189 ERROR [Timer-Driven Process Thread-8] c.k.nifi.nifi_opcua_bundle.GetValue GetValue[id=55c6ac28-015d-1000-076b-844ca709cc40] GetValue[id=55c6ac28-015d-1000-076b-844ca709cc40] failed to process due to java.lang.IllegalArgumentException: Invalid string representation of a nodeId: - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=63; rolling back session: {}
java.lang.IllegalArgumentException: Invalid string representation of a nodeId: - nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=63
at org.opcfoundation.ua.builtintypes.NodeId.parseNodeId(NodeId.java:383)
at com.kentender.nifi.nifi_opcua_services.StandardOPCUAService.getValue(StandardOPCUAService.java:346)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:89)
at com.sun.proxy.$Proxy78.getValue(Unknown Source)
at com.kentender.nifi.nifi_opcua_bundle.GetValue$2.process(GetValue.java:160)
at org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:2529)
at com.kentender.nifi.nifi_opcua_bundle.GetValue.onTrigger(GetValue.java:156)
at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1120)
at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:147)
at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
'nsu=http%3A%2F%2Fopcfoundation.org%2FUA%2F;i=63' represents an ExpandedNodeId, so the Nifi code should use ExpandedNodeId.parseExpandedNodeId() instead of NodeId.parseNodeId().
Or alternatively, you need to convert the ExpandedNodeId to NodeId before you pass it to GetValue(). Unfortunately, I am not familiar with Nifi, so I am not sure which is the correct approach here.
The problem arises from OPC UA "dualism" - some services like Browse, provide ExpandedNodeId references, whereas other services like Read, expect to get NodeId instances.
ExpandedNodeId may define the namespace as an URI ('nsu' in the string) or index ('ns' in the string), where as NodeId may only define the namespace as an index.
I want to create pivot table where column candidate is from DATE column type.
Here is my table preview
And my expected result is like this :
MAIN_RESOURCE | MAIN_USER_NAME | 01-AUG-08 | 01-JUL-08 | 01-JAN-08 | 01-DEC-07 | 01-OCT-07 | next
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
08287060863 90000000000821 0 0 6565 109921 0 next
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
That values in each date column come from TOTAL_AMOUNT, TOTAL_USAGE, AND INVOICE_DEBT.
So, I must have three times of date columns. first for TOTAL_AMOUNT, second for TOTAL_USAGE, and the last one for INVOICE_DEBT.
How to create that?