You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/checks.md
+27-27
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
-
# Checking things
1
+
S# Checking things
2
2
3
3
Using NSClient++ is checks is also pretty straight forward in modern NSClient++ versions.
4
4
With version 0.4.3 we switched all old checks for a new check subsystem which is more uniform as well as more powerful then the old.
5
5
Thanks to a compatibility layer most old command should still work (but there are some snags so be ware when upgrading).
6
6
7
7
Most check have what is refereed to as sensible defaults this means without arguments most checks will do "something sensible".
8
-
This means that to get you started check_cpu will just work as-is. But when you need to do something slightly different you have to start to use the check expressions.
8
+
This means that to get you started `check_cpu` will just work as-is. But when you need to do something slightly different you have to start to use the check expressions.
9
9
10
10
It is important to note that NSClient++ has been around for a long time and the syntax for the checks has changed over time.
11
11
There is a lot of old out dated information about there about the various old syntaxes which is: plain wrong so if you find something about max-warn, filter+ or such: just forget all about it.
@@ -34,7 +34,7 @@ check_cpu show-default
34
34
L cli OK: "filter=core = 'total'" "warning=load > 80" "critical=load > 90" "empty-state=ignored" "top-syntax=${status}: ${problem_list}" "ok-syntax=%(status): CPU load is ok." "detail-syntax=${time}: ${load}%" "perf-syntax=${core} ${time}"
35
35
```
36
36
Now changing the default value is as simple as adding the ones you do not like with a changed option.
37
-
Lets say you want to change warning threshold from 80 to 30 you can do so simply by taking *warn=used > 80%* changing it to the threshold you want *warn=used > 30%*.
37
+
Lets say you want to change warning threshold from 80 to 30 you can do so simply by taking `warn=used > 80%` changing it to the threshold you want `warn=used > 30%`.
38
38
Now add this to the command line of the old command and run that.
39
39
40
40
Modified thresholds:
@@ -51,7 +51,7 @@ Just add the ones you need. On the other hand if you want to keep using an "old"
51
51
### What about removing default values?
52
52
53
53
Sometimes you want to negate the default value by leaving it empty. This might seem impossible at first glance but you can always specify "none" for a given parameter to override the default value and revert back to an empty string.
54
-
For instance to remove the default filter in check_cpu you would use the following command:
54
+
For instance to remove the default filter in `check_cpu` you would use the following command:
The last thing we shall discuss here is a slight snag and this will hopefullt be made better in future version of NSClient++.
65
+
The last thing we shall discuss here is a slight snag and this will hopefully be made better in future version of NSClient++.
66
66
Some default values are not "default value" they are "implicit values". Now this is technically a "bug" but one which might not be fixed any time soon.
67
67
So what does this mean?
68
68
Well in the above command line there was *NO* option for the default times. The check returns the values for 5 seconds, 1 minute and 5 minutes.
69
69
But where did they come from?
70
70
Well, they are so called "implicit values" if a check does not have a given value might be used. These options are almost always related to the data set used such as time or drives or similar.
71
-
So for instance check_drivesize will not have a default option for what to check.
71
+
So for instance `check_drivesize` will not have a default option for what to check.
72
72
To get around this we need simply check the key in the documentation and add it:
73
73
74
74
Different timings:
@@ -84,7 +84,7 @@ And in the next few chapters we will add some deeper understanding on how the fi
84
84
85
85
## Expressions
86
86
87
-
The core feature of the NSCLient++ filter and check language is an expression.
87
+
The core feature of the NSClient++ filter and check language is an expression.
88
88
This expression is modelled after SQL Where clauses and in essence you write an expression which is what will be used by the checks.
89
89
90
90
To look at this we will start with the basics modifying warn/crit threshold checks.
@@ -124,7 +124,7 @@ The safe version of an operator is only to allow expression to be used even when
124
124
The are identical to their unsafe versions apart from the characters used to type them.
125
125
126
126
The keywords available are different for each check and you can always check the various documentation to see a list of available expression for a given check.
127
-
For instance for check_cpu we have.
127
+
For instance for `check_cpu` we have.
128
128
129
129
Check related keywords:
130
130
@@ -161,12 +161,12 @@ Thus writing 5k is equal to writing 5120 but only for size expressions.
161
161
162
162
Filtering works much like expression above except that filters define what to include in a check.
163
163
While there are multiple filters the most common one to use is filter which defined the objects you are interested in.
164
-
We already saw a quick example in the check_cpu command above. The default filter was:
164
+
We already saw a quick example in the `check_cpu` command above. The default filter was:
165
165
166
-
The default check_cpu filter: `"filter=core = 'total'"`
166
+
The default `check_cpu` filter: `"filter=core = 'total'"`
167
167
168
168
What this does is exclude any items which des not evaluate to false. n other words any items which does not have a core value equal to total.
169
-
In the check_cpu command there are values for each core as well as an aggregated total value.
169
+
In the `check_cpu` command there are values for each core as well as an aggregated total value.
170
170
This the above only shows us the total load and the load for each individual core is never used in the check command.
171
171
172
172
Writing filters work exactly like the warning and critical expression we have seen before so we wont cover that again here.
@@ -182,9 +182,9 @@ The syntax configuration is split up into three main keywords:
182
182
- ok-syntax
183
183
184
184
The top-syntax defines the overall message whereas the detail-syntax defines how each entry is formatted.
185
-
The actual values are similar to what we saw before in the filter and warnign/critical thresholds.
185
+
The actual values are similar to what we saw before in the filter and warning/critical thresholds.
186
186
187
-
Looking at check_cpu the default syntaxes (as we have already seen) are:
187
+
Looking at `check_cpu` the default syntaxes (as we have already seen) are:
188
188
```
189
189
top-syntax=${status}: ${problem_list}
190
190
ok-syntax=%(status): CPU load is ok.
@@ -224,15 +224,15 @@ OK: 5m: 0%, 1m: 4%, 5s: 11%
224
224
The difference is that with show-all all the values are shown.
225
225
By default when we run a check only values which are bad are included in the message but if we always want to see the values we can specify show-all.
226
226
For instance if the CPU load had been above the warning threshold we would have seen the value included in the message.
227
-
Now show-all is not magical it only modifies the top-syntax replacing %(problem_list) with %(list).
227
+
Now show-all is not magical it only modifies the top-syntax replacing `%(problem_list)` with `%(list)`.
228
228
This is something you could have achieved yourself but show-all makes it simpler as well as makes intent much clearer.
229
229
230
230
## Advanced options
231
231
232
232
### Performance data configuration
233
233
234
234
Performance data is something which a lot of people want to tweak and customize.
235
-
And the simplest way to do so is using the perf-config command line options.
235
+
And the simplest way to do so is using the `perf-config` command line options.
236
236
This command line option is a bit more complicated then changing filters as it is very free form.
237
237
It works a bit like CSS style sheets where you have selectors and lists of keys and values.
238
238
If you are not familiar with CSS it does not matter as the similarity is very brief and we will explain how they work.
@@ -245,8 +245,8 @@ L cli CRITICAL: CRITICAL ...
245
245
L cli Performance data: 'C:\ used'=213.75593GB;178.77655;201.12362;0;223.47069 'C:\ used %'=95%;79;89;0;100 'D:\ used'=400.62005GB;372.60702;419.1829;0;465.75878 'D:\ used %79;89;0;100 'E:\ used'=0B;0;0;0;0
246
246
```
247
247
248
-
The performance data here is quite long so lets break it up into a table. To do this we can use a built in helper function in NSCLient++.
249
-
The function format_perf will execute another command and render the performance data as the return message.
248
+
The performance data here is quite long so lets break it up into a table. To do this we can use a built in helper function in NSClient++.
249
+
The function `format_perf` will execute another command and render the performance data as the return message.
Copy file name to clipboardexpand all lines: docs/faq.md
+27-27
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ NSCP has a built-in "test and debug" mode that you can activate with the followi
6
6
7
7
What this does is two things.
8
8
9
-
1. it starts the daemon as "usual" with the same configuration and such.
10
-
2. it enables debug logging and logs to the console.
11
-
This makes it quite easy to see what is going on and why things go wrong.
9
+
1.it starts the daemon as "usual" with the same configuration and such.
10
+
2.it enables debug logging and logs to the console.
11
+
This makes it quite easy to see what is going on and why things go wrong.
12
12
13
13
14
14
## 1.2 MSI or ZIP installation?
@@ -23,19 +23,19 @@ The MSI is the preferred way to install NSClient++ and will work much better the
23
23
- Second thing to check is whether the servers' performance counters working?
24
24
Sometimes the performance counters end up broken and need to be rebuilt there is a command to validate performance counters: `nscp sys --validate`
25
25
26
-
For details: Microsoft KB: http://support.microsoft.com/kb/300956 essentially you need to use the `lodctr /R` command.
26
+
For details: Microsoft KB: [http://support.microsoft.com/kb/300956](http://support.microsoft.com/kb/300956) essentially you need to use the `lodctr /R` command.
27
27
28
28
## 1.4 Bind failed
29
29
30
30
Usually this is due to running more then once instance of NSClient++ or possibly running another program that uses the same port.
31
31
32
-
- Make sure you don't have any other instance NSClient++ started.
33
-
- Check if the port is in use (`netstat -a` look for LISTENING)
32
+
-Make sure you don't have any other instance NSClient++ started.
33
+
-Check if the port is in use (`netstat -a` look for LISTENING)
34
34
35
35
## 1.5 EventlogBuffer is too small
36
36
37
37
!!! note
38
-
This has been fixed in 0.4.3 and is no longer required
38
+
This has been changed in 0.4.3 and is no longer required
39
39
40
40
This is because you have one or more entries in your event-log which are larger then the "default buffer size of 64k". The best way to fix this is to increase the buffer used.
41
41
@@ -47,7 +47,7 @@ buffer_size=128000
47
47
## 1.6 System Tray does not work
48
48
49
49
!!! note
50
-
System tray is currently disabled and will be added back at some point
50
+
System tray was removed in 0.4.0.
51
51
52
52
## 1.7 I get <insertrandomerrorfromNagioshere>
53
53
@@ -65,11 +65,11 @@ net start nscp
65
65
66
66
Please check and include this information before you submit questions and/or bug reports.
67
67
68
-
## 1.8 High CPU load and check_eventlog
68
+
## 1.8 High CPU load and `check_eventlog`
69
69
70
70
Some people experience high CPU load when checking the event log this can usually be resolved using the new command line option scan-range setting it to the time region you want to check
71
71
72
-
`CheckEventLog ... scan-range=12h ...`
72
+
`check_eventlog ... scan-range=12h ...`
73
73
74
74
## 1.9 Return code of 139 is out of bounds
75
75
@@ -145,12 +145,12 @@ allow nasty characters=true
145
145
146
146
To not use nasty characters you can replace man y of them in built-in commands:
147
147
148
-
|Expression|Replacement|
149
-
|----------|-----------|
150
-
|>|gt|
151
-
| <|lt|
152
-
| '|str(...) |
153
-
|${..} | %(..) |
148
+
|Expression|Replacement|
149
+
|------------|-------------|
150
+
|>| gt|
151
+
|< | lt|
152
+
|' |str(...)|
153
+
| ${..} | %(..)|
154
154
155
155
156
156
# 3. Versions
@@ -166,7 +166,7 @@ In generally do NOT fix issues in several years old versions.
166
166
167
167
# 4. Network
168
168
169
-
## 4.1 Rejected connection from: <ipaddresshere>
169
+
## 4.1 Rejected connection from: your IP address here
170
170
171
171
This is due to invalid configuration.
172
172
One important thing you '''NEED''' to configure is which hosts are allowed to connect. If this configuration is missing or invalid you will get the following error:
@@ -193,34 +193,34 @@ The Nagios server timeout will fire after exactly 60 seconds but the script time
193
193
194
194
If your command takes 60 seconds you need to set the timeouts like this:
## 5.2 What's the difference between CheckFoo and check_foo
242
+
## 5.2 What's the difference between `CheckFoo` and `check_foo`
243
243
244
-
In older version of NSClient++ (pre 0.4.1) there were only CheckFoo type commands so they where called CheckCPUCheckMemCheckProcess etc etc...
245
-
In 0.4.2 we introduced a new set of commands which were more generic and similar and they are called check_cpucheck_memorycheck_process etc etc..
244
+
In older version of NSClient++ (pre 0.4.1) there were only `CheckFoo` type commands so they where called `CheckCPU``CheckMem``CheckProcess` etc etc...
245
+
In 0.4.2 we introduced a new set of commands which were more generic and similar and they are called `check_cpu``check_memory``check_process` etc etc..
246
246
The previous ones are only for compatibility and will eventually be removed from NSClient++.
247
247
Currently they are about 90% compatible which means some things will not work as before and some commands are not even present anymore.
248
248
@@ -252,7 +252,7 @@ Currently they are about 90% compatible which means some things will not work as
252
252
## 5.3 I use check_nt and...
253
253
254
254
Check_nt is NOT a good protocol and is considered abandon-ware as noone updates the check_nt command any longer. NSClient++ supports it only for legacy reasons.
255
-
There is generally no reason to use check_nt as check_nrpe and check_nscp can achieve the same thing.
255
+
There is generally no reason to use `check_nt` as `check_nrpe` and `check_nscp` can achieve the same thing.
256
256
257
257
## 5.4 MEMUSE reports the wrong value
258
258
@@ -296,7 +296,7 @@ ssl = true
296
296
insecure = true
297
297
```
298
298
299
-
If you instead opt to use the more secure standard SSL approach used in NSClient++ you can easily install NSClient++ on a linux system as well.
299
+
If you instead opt to use the more secure standard SSL approach used in NSClient++ you can easily install NSClient++ on a Linux system as well.
0 commit comments