Skip to content

Commit

Permalink
Add px/agent_status_diagnostics pxl script (#2064)
Browse files Browse the repository at this point in the history
Summary: Add px/agent_status_diagnostics pxl script

This PR adds a new pxl script that helps identify if linux headers are
missing on any PEMs. This can be extended in the future, but the first
use cause will be to execute the script during `px deploy` and `px
collect-logs`.

Relevant Issues: #2051

Type of change: /kind feature

Test Plan: Ran the script in the UI and tested it as part of the
validation for #2065

![Screen Shot 2024-12-18 at 10 51 15
AM](https://github.com/user-attachments/assets/bd4ab6de-ad92-4af3-8714-b044a7df7d65)


Changelog Message: Add `px/agent_status_diagnostics` pxl script for
checking common issues

Signed-off-by: Dom Del Nano <[email protected]>
  • Loading branch information
ddelnano authored Jan 6, 2025
1 parent 9c6803e commit a1a1d0e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/pxl_scripts/px/agent_status_diagnostics/agent_status.pxl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2018- The Pixie Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

import px

# Exclude kelvins since they don't run BPF programs nor
# do they have the host linux headers accessible
df = px.GetAgentStatus(False)
df = df.agg(
installed=('kernel_headers_installed', px.sum),
count=('kernel_headers_installed', px.count),
)
df.headers_installed_percent = df.installed / df.count
df = df.drop(['installed', 'count'])
px.display(df)
4 changes: 4 additions & 0 deletions src/pxl_scripts/px/agent_status_diagnostics/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
short: Agent status diagnostics
long: >
This script performs diagnostics on the agents' (PEMs/Collectors) status

0 comments on commit a1a1d0e

Please sign in to comment.