Skip to content

Commit a1a1d0e

Browse files
authored
Add px/agent_status_diagnostics pxl script (#2064)
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]>
1 parent 9c6803e commit a1a1d0e

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2018- The Pixie Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
import px
18+
19+
# Exclude kelvins since they don't run BPF programs nor
20+
# do they have the host linux headers accessible
21+
df = px.GetAgentStatus(False)
22+
df = df.agg(
23+
installed=('kernel_headers_installed', px.sum),
24+
count=('kernel_headers_installed', px.count),
25+
)
26+
df.headers_installed_percent = df.installed / df.count
27+
df = df.drop(['installed', 'count'])
28+
px.display(df)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
short: Agent status diagnostics
3+
long: >
4+
This script performs diagnostics on the agents' (PEMs/Collectors) status

0 commit comments

Comments
 (0)