Skip to content

Make check_fdb.py generate commands to fix fdb#108

Open
matteopozza wants to merge 3 commits intomasterfrom
CCCP-5211
Open

Make check_fdb.py generate commands to fix fdb#108
matteopozza wants to merge 3 commits intomasterfrom
CCCP-5211

Conversation

@matteopozza
Copy link
Copy Markdown
Contributor

@matteopozza matteopozza commented Apr 13, 2026

Opsview check check_fdb currently produces information on records that need to be fixed in the fdb in a human-readable form. The admin still needs to compose those information into commands to fix the identified issues. The proposed change add to the opsview check the capability of generating the commands to fix the fdb problematic records, so that the admin can run directly the generated commands.

@matteopozza matteopozza changed the title WIP: Make check_fdb.py generate commands to fix fdb Make check_fdb.py generate commands to fix fdb Apr 14, 2026
"00:00:00:00:00:00",
]

COMMANDS_FILE_PATH = "/run/nrpe/fix_fdb.sh"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default nrpe service is configured to have a private tmp folder. As a consequence, when writing to /tmp (or /var/tmp) folder, the content is actually written into /tmp/systemd-private-....-nrpe.service.../tmp. This is a bit unfortunate because we do not want to change the /tmp setting for all the infra, but admins might forget about the private tmp peculiarity.
For this reason, I am proposing to put it in /run/nrpe folder. The folder is meant to be used for runtime data, and nrpe user has enough rights to write in it.

# make sure file has correct permissions
os.chmod(
COMMANDS_FILE_PATH,
stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | # owner (7)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm suggesting an unusual 754 as permission combination because:

  • we are fine with anyone being able to read the content of the script
  • we need at least the nrpe user to be able to write to the file
  • the script needs to be run by root. Nevertheless, if it is not marked as executable, then root itself will need to do a chmod to run the script. By granting execution permissions to nrpe we avoid this inconvenient. I have extended the execution permissions to the group as well, but it is probably not necessary so we could also try 744 if we want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant