39 Commits

Author SHA1 Message Date
Scott Little
edc8f343d6 fix yum urls for vaulted CentOS 8
CentOS 8 has been vaulted.  We need to fix the yum urls
to continue to use it.

A longer term fix is to migrate to a new/different base image,
but is outside the scope of this fix which only addresses
broken builds.

Partial-Bug: 1995630
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: Id8b32ee27a65f74c616b07e37f8f5f2914176264
(cherry picked from commit 9ac9f7878b5d9a9ddf88e5c1fb824bc5e57911c0)
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2022-11-03 14:52:51 -04:00
Scott Little
ff64b3f3aa Update .gitreview for r/stx.6.0
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: Id8e63307d23095fa61d0b7f9be463e6fd2b90777
6.0.0
2021-12-10 00:17:44 -05:00
Takamasa Takenaka
e9fa90a028 Modify values.yml to match expected format
When system application-apply, the script will download
containers and upload them to the local registry.
(This process includes repository re-written with
system parameter configuration)

Current in values.yaml of snmp armada app, only
stx-snmp container configuration matched to the
expected pattern. So that the script downloaded
only stx-snmp container but no other two containers.

This fix modifies the format in values.xml to
match the expected pattern (No value changes for
repositories nor tags)

Test Plan:
PASS: Apply snmp-armada-app and confirm the followings:
      - Status becomes "applied"
      - All 3 containers download from configured repository
      - All 3 containers are in the local repository

Closes-bug: 1952654

Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com>
Change-Id: I8b742a2e211717b343f459443b15e947e5c6bd92
vr/stx.6.0
2021-11-29 15:58:40 -03:00
Takamasa Takenaka
ae2128355b Update tag for stx-snmp to stx.6.0-v1.0.1
Update yaml file with a new tag for stx-snmp, due to
a new fix to remove Titianium cloud text from mibs.

Test Plan:
PASS:Apply snmp-armada-app and confirm stx-snmp
     tag is stx.6.0-v1.0.1 by "kubectl describe"

Closes-bug: 1947611

Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com>
Change-Id: Ifb22164acdc16bb66b56bf02e42eb1b0214e758d
2021-11-10 14:40:52 -03:00
Takamasa Takenaka
2f6c78ef33 Update tag for stx-fm-trap-subagent to stx.6.0-v1.0.2
Update list file with a new tag for stx-fm-trap-subagent, due to
a new fix

Test Plan:
PASS:Apply snmp-armada-app and confirm stx-fm-trap-subagent
     tag is stx.6.0-v1.0.2 by "kubectl describe"

Closes-Bug: 1943612

Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com>
Change-Id: If8db42e2b43307bac2963f1e30cdc57f5184f1d0
2021-11-10 11:05:58 -03:00
Takamasa Takenaka
ef71ead777 Update tag for stx-fm-subagent to stx.6.0-v1.0.3
Update values.yaml with a new tag for stx-fm-subagent, due to
a new fix to retry to connect alarm/event database if it fails.

Closes-bug: 1949083

Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com>
Change-Id: I649d6a8e62acf98cf8bca694c41eab0d89170930
2021-11-08 15:32:04 -03:00
Takamasa Takenaka
5642841ebc Retry get alarms/events for SNMP if it fails
Root cause:
SNMP sub-agent uses fm-common library to connect database
to obtain alarm/event list. But after swact, it does not
detect disconnection and as the result, the functions to
obtain alarm/event returns false and does not return proper
list.

Analysis:
fm-common library to connect to the database. It checks
connection by PQstatus() and it will reconnect if it find
connection error. But PQstatus responses CONNECTION_OK
even after swact. The other option to check connection is
using PQPing(). But this method also responses PQPING_OK
even after awact, too.
Other option is sending real SQL and it is same as to
retry. So this solution is to retry to obtain alarm/
event list if it fails.

Solution:
When SNMP sub-agent calls to obtain alarm/event list
and it returns false, retry it. Internally, it reconnects
automatically and it returns the proper list.

Test Plan:
Test the following steps for snmpget, snmpgetnext, snmpbulkget
and snmpwalk in IPv4 and IPv6:
1. Execute "system host-swact controller-n"
2. Send snmp command and record response
3. Send snmp command and record response
4. Compare 2. and 3. response and confirm they are matched
=> all cases PASS

Closes-bug: 1949083

Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com>
Change-Id: Ib58f9f657bb5ac8c3b505eee5443a24bedb2463e
2021-11-01 17:05:47 +00:00
Jorge Saffe
1904f3ad6d Titanium cloud references have been removed from wrsEnterpriseReg.mib.txt as per product name change
Test Plan:
- No test plan was necessary as mainly documentation changes were made, changing the old references to Titanium and removing OIDs from obsolete products.

Closes-Bug: 1947611

Signed-off-by: Jorge Saffe <jsaffe@yow-cgts1-lx.wrs.com>
Change-Id: Ibae61af66f3d0166e10862f4e2cb616bdf216981
2021-10-19 14:37:30 -04:00
Gustavo Dobro
731c89678d Revert "Titanium cloud references have been removed from wrsEnterpriseReg.mib.txt as per product name change"
This reverts commit 7b7254241f2de548a4577a6d074a10fe89f231fc.

Reason for revert: It was not followed the bug submission template including the test plan and the launchpad id.

Change-Id: I5e1ec5c525e487d1deb410ea6349ee6d887dda8b
2021-10-19 01:08:23 +00:00
jsaffe
7b7254241f Titanium cloud references have been removed from wrsEnterpriseReg.mib.txt as per product name change
Signed-off-by: jsaffe <jorge.saffe@windriver.com>
Change-Id: I8b359e16c76b2a116e6facfb31e1b5d3ada5bdef
2021-10-14 13:48:34 -04:00
Charles Short
d6d80b5d36 Fix unit tests
Due to a recent change in fm-api's directory structure, unit tests would
fail since the virtualenv would not be able to find fm-api/setup.py.
Adjust the tox.ini to point to the correct directory. Tested locally
by running tox.ini.

Depends-On: https://review.opendev.org/c/starlingx/fault/+/806046

Story: 2009101
Task: 43091

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: Iec8f443d7a3021ec86bb8319597d3ab2d2933d7c
2021-09-28 14:24:34 -04:00
Jose Infanzon
9b6053ae97 Fix snmp trap behaviour on IPv6 environments.
Modifications done to retrieve new sub agent images that
support IPv6.

Closes-Bug: 1943612

Signed-off-by: Jose Infanzon <jose.infanzon@windriver.com>
Change-Id: Ia0b4ffb20c11a28821d099a70413691f2a1c9ad2
2021-09-23 11:38:16 -03:00
Zuul
0f28a309ca Merge "Add toleration to snmp pods" 2021-09-22 20:47:37 +00:00
Zuul
8b9f07e4aa Merge "Add pylint py3 portability checks for the k8sapp_snmp" 2021-09-21 15:07:29 +00:00
Zuul
57249f526f Merge "Fix snmp trap (Coldstart, Warmstart, or other Fault Managment alarm traps) behaviour on IPv6 environments." 2021-09-20 20:44:49 +00:00
Enzo Candotti
602e6c4783 Add toleration to snmp pods
A toleration needs to be added to all pods since the
node-role.kubernetes.io/master taint will be restored to all master
nodes. This will ensure that the pod will run on the master node.

Story: 2009232
Task: 43339

Signed-off-by: Enzo Candotti <enzo.candotti@windriver.com>
Change-Id: I986b16217f8f5fbb0b902d29b30d0a2c9a718273
2021-09-16 17:40:47 -03:00
Jorge Saffe
f7de093305 Fix snmp trap (Coldstart, Warmstart, or other Fault Managment alarm traps) behaviour on IPv6 environments.
Modifications have been made in the containers of the snmp-armada-app, and  deployment and values files of helm chart package.
The following changes are made:
1. Bootstrap.sh scripts of snmp trap-subagent and sub-agent were modified to waits until the master agent container is up, to intialize them.
2. Add an environment variable to set the maxium numer or tries until raise a communication error and restart the pod.
3. Add other environment variables for testing purpose that can be modified with a helm override, like the master agent address and port.
4. Add an init_container in the snmp pod thats applies a delay when de pod starts, to solve ColdStart traps missing.

Closes-Bug: 1943612

Signed-off-by: Jorge Saffe <jorge.saffe@windriver.com>
Change-Id: I2cd4a6309e99ba73257253077dc13b3b725043dd
2021-09-16 12:02:13 -03:00
Bernardo Decco
386b5daa15 Add pylint py3 portability checks for the k8sapp_snmp
A lot of work has gone into making sure that StarlingX is python3
compatible. To ensure future compatibility, enable the python3
portability checks. Disable the checks that are raising errors.
Another set of commits will address the offending code.

Story: 2006796
Task: 43208

Signed-off-by: Bernardo Decco <bernardo.deccodesiqueira@windriver.com>
Change-Id: I6505bb489049f8666bfb97788353ecc77e74ddf5
2021-09-15 11:08:09 -03:00
Charles Short
75694acecc Enable py39 tox gate/test for app plugins
Add support for tox testing under Debian Bullseye by enabling a
python 3.9 gate and tox target for exercising plugin unit tests.

Story: 2009101
Task: 43188

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: Ie7f0f4efd809fafb95a14274c400e7cb2f8458b9
2021-09-13 14:04:33 -04:00
Zuul
c6c16c0682 Merge "Improve to obtain db url for fm" vr/stx.5.0 2021-03-26 13:14:13 +00:00
Takamasa Takenaka
e3be280131 Improve to obtain db url for fm
Obtain db url for fm without through puppet.
So that we could remove dependency with puppet.

Story: 2008132
Task: 42101
Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com>
Change-Id: I51028de89a39b7e8baa3b5f5c71ff0bb7b5874b5
2021-03-25 14:45:09 -03:00
Jose Infanzon
0d99f2efa4 Modify stx-fm-trap-subagent tag
Update yaml file with a new tag for stx-fm-trap-subagent,
due to a new commit delivered to support IPv6

Story: 2008132
Task: 42064
Signed-off-by: Jose Infanzon <jose.infanzon@windriver.com>
Change-Id: I55bdf71d4ea662beda26f5e221e1dcb67f11d803
Depends-On: Id8a12b4c68b887ff153490af5e8084d7ee5224fe
2021-03-16 23:34:21 +00:00
Gonzalo Gallardo
e7fc57ed4c Add default configuration for IPV6
This patch adds the default settings for IPv6 in the net-snmp
configuration file "snmpd.conf".

Story: 2008132
Task: 42029
Signed-off-by: Gonzalo Gallardo <gonzalo.gallardo@windriver.com>
Change-Id: I2fe68ed5108c552c27d166eb313544c823fba3ab
2021-03-10 12:59:09 -03:00
Zuul
872c2a6602 Merge "Adding support IPv6 to the fm-trap-subagent" 2021-02-22 18:28:15 +00:00
Pablo Bovina
5aca0dd166 Adding support IPv6 to the fm-trap-subagent
Now the server that runs in the fm-trap-subagent
is able to recieve messages when it runs
in a StarlingX with IPv6 environment.

This server is responsible to receive
the alarm metada and generate the traps
accordingly to the configuration in the
master agent.

Story: 2008132
Task: 41774
Signed-off-by: Pablo Bovina <pablo.bovina@windriver.com>
Change-Id: I89b1d8e7c97d315637b12bcfea0269f2fcf8d452
2021-02-17 16:14:48 -03:00
Gonzalo Gallardo
e78e8b757e Add info name, location and contact to snmpd.conf
Add SNMP system information including name, location and contact details
in the fields sysContact, sysLocation and sysName of the snmpd.conf file.
Also can be setted the field sysDesc with system description.

Story: 2008132
Task: 41716
Signed-off-by: Gonzalo Gallardo <gonzalo.gallardo@windriver.com>
Change-Id: I0ed5a347f8be7e11e4acb37392520e4702183ddf
2021-02-12 00:31:39 -03:00
Dan Voiculeasa
f15426c720 Introduce lifecycle operator to snmp app
Following hooks were necessary:
  pre-apply-rbd, pre-apply-resource, post-remove-rbd,
  post-remove-resource, post-apply, post-remove

Change-Id: I533f2bd41c5627f83a004ffbf4543dd3c26d06b7
Story: 2007960
Task: 41579
Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
2021-01-13 23:30:21 +02:00
Zuul
b333ef2a63 Merge "Configure Docker images tags for SNMP" 2021-01-12 15:30:07 +00:00
Don Penney
07bbbd79b0 Remove empty package from python-k8sapp-snmp
Packages defined in a spec with no files do not result in an RPM
produced by the build. On a rebuild, the build tools scan the spec and
sees the package defined but does not find a corresponding RPM, and so
flags the package for a rebuild as a result.

This commit removes the empty package definition from the spec.

Partial-Bug: 1910439
Signed-off-by: Don Penney <don.penney@windriver.com>
Change-Id: Ia12515d4faae679a30c34fa2d47d5fa2738900b3
2021-01-06 14:37:50 -05:00
Gonzalo Gallardo
882c68debd Configure Docker images tags for SNMP
Configure a new repo/registry "docker.io/starlingx" for the images used by the SNMP app.

Story: 2008132
Task: 41526
Signed-off-by: Gonzalo Gallardo <gonzalo.gallardo@windriver.com>

Depends-On: https://review.opendev.org/769386
Change-Id: I6d99ba3f1dd3badb55871825153930e19ad790b8
2021-01-05 16:17:40 +00:00
Gonzalo Gallardo
2b370655a7 Support enabling DEBUG log mode for all SNMP containers into the POD
Enable/Disable the verbose logging to debug the application SNMP including master-agent,subagent and trap-subagent running on containers. Add parameter "-DALL" to turn on debugging output.

Story: 2008132
Task: 41410
Signed-off-by: Gonzalo Gallardo <gonzalo.gallardo@windriver.com>
Change-Id: Id0f68ae1bcfba7086ad20a27748cd272c3477d81
2020-12-14 20:31:44 +00:00
Scott Little
0fd1e0fbaa Fix stx-fm-trap-subagent Dockerfile ref to PowerTools
PowerTools is not the correct repo name.  It should be
'powertools'.  This appears to be a change in the newly
released centos8.3.2011.  PowerTools os trademarked by
RedHat.

Closes-Bug: 1907277
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: I55756a8005c1821c98194b372573757e0fb733bb
2020-12-08 11:13:05 -05:00
Zuul
00e7c21d32 Merge "Audit plugin for SNMP operations" 2020-12-04 18:08:15 +00:00
Nicolas Alvarez
58bdb27379 Liveness and readiness probes
Commented implementation until kubernetes issues are resolved.

Story: 2008132
Task: 41317
Signed-off-by: Nicolas Alvarez <nicolas.alvarez@windriver.com>

Change-Id: I1d4018f6f92344097661116a4267129d560ade71
2020-12-01 17:25:59 +00:00
Jose Infanzon
1d7489c856 Audit plugin for SNMP operations
The Audit plugin is resposible to
log the incoming SNMP operations
to the master agent.

Signed-off-by: Jose Infanzon <jose.infanzon@windriver.com>
Story: 2008132
Task: 41312
Depends-On: https://review.opendev.org/761792
Change-Id: Iffa22c5ce67859168ab45eec4576a58a87aeba98
2020-11-28 01:04:27 +00:00
Gonzalo Gallardo
67e1939509 Upload fm-subagent, fm-trap-subagent and armada plugin.
Upload fm-subagent and fm-trap-subagent to our snmp armada
application integrated with armada plugin.

Change-Id: I2c7b3a65f2e97c147068d0c3c41c52e814bb0e2e
Story: 2008132
Task: 41227
Signed-off-by: Gonzalo Gallardo <gonzalo.gallardo@windriver.com>
2020-11-27 17:00:30 -03:00
Nicolas Alvarez
78bdafbbde Initial commit for snmp-armada-app skeleton
This is the initial commit for the app skeleton.

- centos files: files related with the infra and docker images
- rst files: files with doc about snmp-armada-app
- stx-snmp-helm folder: files related with helm charts and
  the app creation

Story: 2008132
Task: 41122

Change-Id: I0c4b9843544228bb04cb26504674134dd0e3ceb8
Signed-off-by: Nicolas Alvarez <nicolas.alvarez@windriver.com>
2020-10-23 15:15:54 +00:00
Nicolas Alvarez
2b8c8588d8 snmp-armada-app repo setup
- .zuul.yaml: add config about mirroring and secret github key
- requirements.txt: empty file for futures requirements
- test-requirements.txt: file with requirements for testing
- tox.ini: file to setup the test environment

Story: 2008132
Task: 41107

Change-Id: I7e5ce441e783963017f578ee0647f224ea3773ee
Signed-off-by: Nicolas Alvarez <nicolas.alvarez@windriver.com>
2020-10-14 19:37:34 +00:00
OpenDev Project Creator
be277c83a9 Added .gitreview 2020-10-14 15:42:16 +00:00