nrpe check_proliant
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: nrpe check_proliant
Let us know.
Re: nrpe check_proliant
hpasmcli has the same on all pc's
that what I got on a problem server running as root
SELinux - disabled-rwxr-xr-x 1 root root 184800 Jun 29 06:18 hpasmcli
that what I got on a problem server running as root
[root@callme-lekki-smg1 plugins]# ./check_proliant.py --type=fan
CRITICAL: Fan #1 Status=No. Fan #1 Speed=-. Fan #1 Redundant=N/A. Fan #2 Status=No. Fan #2 Speed=-. Fan #2 Redundant=N/A.
Re: nrpe check_proliant
Well, if it is not working as root, then it is not a permission problem. Is the hpasmcli utility in the same directory on each system? Are there any path differences between the systems:
Code: Select all
echo $PATHFormer Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: nrpe check_proliant
SElinux disabled on all pc's
that's what i got running check_proliant.py locally as root
/sbin/hpasmcli - -rwxr-xr-x 1 root root 184800 Jun 29 06:18 hpasmcli on all pc's
that's what i got running check_proliant.py locally as root
[root@callme-lekki-smg1 plugins]# ./check_proliant.py --type=fan
CRITICAL: Fan #1 Status=No. Fan #1 Speed=-. Fan #1 Redundant=N/A. Fan #2 Status=No. Fan #2 Speed=-. Fan #2 Redundant=N/A.
/sbin/hpasmcli - -rwxr-xr-x 1 root root 184800 Jun 29 06:18 hpasmcli on all pc's
Re: nrpe check_proliant
All looks good, you are stumping me quick.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: nrpe check_proliant
anyway, thank you for your help
Re: nrpe check_proliant
the problem is solved
it is check_proliant/py internal code problem,
later on I'll put here a code I changed with all explanations
give me pls some time
it is check_proliant/py internal code problem,
later on I'll put here a code I changed with all explanations
give me pls some time
Re: nrpe check_proliant
Sure thing. Don't reply to this post until you're ready to share the code, otherwise the thread will be bumped back into our "TODO" queue.
Former Nagios employee
Re: nrpe check_proliant
sorry moderators, I didn't submit anything but .... so I continue with code example , check my previous post about problem
pls, pay attention to lines 44,89,96, 100-102,108,113
the code amendments were done by Lukasz Piwowarek - thanks a lot to him for his job
pls, pay attention to lines 44,89,96, 100-102,108,113
now everything works fine for me34 import time, sys, pexpect, getopt
35
36 HPASMCMD = "sudo /sbin/hpasmcli"
37 HPASM_PROMPT = "hpasmcli>"
38 WARN_TEMP_PCT = 10 # warn if we're within 10% of our temp threshold
39
40 is_CRITICAL = 0
41 is_WARNING = 0
42 message = ""
43
44 fans_to_skip = [ "#1", "#2" ]
45
46 # usage info
47 def usage():
48 print "check_proliant.py - GPL Python Script by Jason Antman"
49 print "http://www.jasonantman.com"
50 print "checks hplog and returns values for use by Nagios"
51 print ""
52 print "Usage:"
53 print "check_hplog.py --type=[fan|ps|temp|proc|dimm|all] [--ignore-redundant] [-h | --h elp]"
54 print " type: what information to get - fan, ps, temp, proc, dimm, all"
55 print " -h --help: print this usage summary"
56
57 def doFans(ignoreRedundant):
58 result = ""
59 try:
60 child = pexpect.spawn(HPASMCMD)
61 child.expect(HPASM_PROMPT)
62 child.sendline("SHOW FANS")
63 child.expect(HPASM_PROMPT)
64 result = child.before
65 child.sendline("EXIT")
66 time.sleep(1)
67 child.close()
68 child.close()
69 except pexpect.ExceptionPexpect:
70 pass
71 except exceptions.OSError:
72 pass
73
74 if result.strip() == "":
75 print "UNKNOWN: Error in pexpect while running hpasmcli"
76 sys.exit(3)
77 lines = result.split("\n")
78
79 # variables to hold state
80 total_fans = 0
81 fans_missing = 0
82 global is_CRITICAL
83 global is_WARNING
84 global message
85 test_ok = 1
86
87 for line in lines:
88 # skip over blank lines or command echo
89 if line.strip() == "" or line.strip() == "SHOW FANS":
90 continue
91 # skip over formatting lines and column headings
92 if line[:8] == "Fan Loc" or line[:8] == "--- ---":
93 continue
94
95 # THIS IS AN IMPORTANT LINE
96 total_fans = total_fans + 1
97 fields = line.split() # get the fields
98 fanNum = fields[0]
99 # is_present
100 if fanNum in fans_to_skip:
101 total_fans -= 1
102 if (fields[2] != "Yes") and (fanNum not in fans_to_skip):
103 fans_missing = fans_missing + 1
104 is_CRITICAL = 1
105 test_ok=0
106 message = message + "Fan " + fanNum + " Status=" + fields[2] + ". "
107 # speed
108 if (fields[3] != "NORMAL") and (fanNum not in fans_to_skip):
109 is_WARNING = 1
110 test_ok=0
111 message = message + "Fan " + fanNum + " Speed=" + fields[3] + ". "
112 # is redundant
113 if (ignoreRedundant == 0) and (fields[5] != "Yes") and (fanNum not in fans_to_skip) :
114 is_CRITICAL = 1
115 test_ok=0
116 message = message + "Fan " + fanNum + " Redundant=" + fields[5] + ". "
117
118 if test_ok == 1:
119 message = message + str(total_fans) + " fans normal."
120 return test_ok
the code amendments were done by Lukasz Piwowarek - thanks a lot to him for his job
Re: nrpe check_proliant
Thanks for sharing!
Be sure to check out our Knowledgebase for helpful articles and solutions!