File: 18_check_snmp_process_tmp_file

package info (click to toggle)
nagios-snmp-plugins 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,008 kB
  • ctags: 381
  • sloc: perl: 7,178; sh: 309; makefile: 50
file content (32 lines) | stat: -rw-r--r-- 984 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## 18_check_snmp_process_tmp_file by S.Bay
##
## DP: Fix tmp file check_snmp_process

## From 88c3bfd626a531e7da1c3e3c694f6fd1d4a70692 Mon Sep 17 00:00:00 2001
## From: "S.Bay" <info@space2place.de>
## Date: Tue, 17 Dec 2013 09:32:15 +0100
## Subject: [PATCH] Fix error writing tmp file using plugin with remote unix
##  system

---
 check_snmp_process.pl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/check_snmp_process.pl b/plugins/check_snmp_process.pl
index 7a83432..11f2d96 100755
--- a/check_snmp_process.pl
+++ b/check_snmp_process.pl
@@ -640,6 +640,10 @@ sub check_options {
   #### Read file
   $temp_file_name=$o_descr;
   $temp_file_name =~ s/ /_/g;
+  $temp_file_name =~ s/\//_/g;
+  $temp_file_name =~ s/-//g;
+  $temp_file_name =~ s/=//g;
+  $temp_file_name = substr($temp_file_name,0,40);
   $temp_file_name = $o_base_dir . $o_host ."." . $temp_file_name; 
   # First, read entire file
   my @ret_array=read_file($temp_file_name,$n_items_check);
-- 
1.8.5.5