Skip to content

Commit 201e10d

Browse files
committed
more markdown formatting fixes
1 parent d0ab174 commit 201e10d

File tree

5 files changed

+90
-91
lines changed

5 files changed

+90
-91
lines changed

docs/checks.md

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Checking things
1+
S# Checking things
22

33
Using NSClient++ is checks is also pretty straight forward in modern NSClient++ versions.
44
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.
55
Thanks to a compatibility layer most old command should still work (but there are some snags so be ware when upgrading).
66

77
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.
99

1010
It is important to note that NSClient++ has been around for a long time and the syntax for the checks has changed over time.
1111
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
3434
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}"
3535
```
3636
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%`.
3838
Now add this to the command line of the old command and run that.
3939

4040
Modified thresholds:
@@ -51,7 +51,7 @@ Just add the ones you need. On the other hand if you want to keep using an "old"
5151
### What about removing default values?
5252

5353
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:
5555

5656
Remove filters:
5757
```
@@ -62,13 +62,13 @@ L cli Performance data: 'total 5m'=0%;80;90 'core 0 1m'=0%;80;90 'core 1
6262

6363
### Implicit defaults
6464

65-
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++.
6666
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.
6767
So what does this mean?
6868
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.
6969
But where did they come from?
7070
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.
7272
To get around this we need simply check the key in the documentation and add it:
7373

7474
Different timings:
@@ -84,7 +84,7 @@ And in the next few chapters we will add some deeper understanding on how the fi
8484

8585
## Expressions
8686

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.
8888
This expression is modelled after SQL Where clauses and in essence you write an expression which is what will be used by the checks.
8989

9090
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
124124
The are identical to their unsafe versions apart from the characters used to type them.
125125

126126
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.
128128

129129
Check related keywords:
130130

@@ -161,12 +161,12 @@ Thus writing 5k is equal to writing 5120 but only for size expressions.
161161

162162
Filtering works much like expression above except that filters define what to include in a check.
163163
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:
165165

166-
The default check_cpu filter: `"filter=core = 'total'"`
166+
The default `check_cpu` filter: `"filter=core = 'total'"`
167167

168168
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.
170170
This the above only shows us the total load and the load for each individual core is never used in the check command.
171171

172172
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:
182182
- ok-syntax
183183

184184
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.
186186

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:
188188
```
189189
top-syntax=${status}: ${problem_list}
190190
ok-syntax=%(status): CPU load is ok.
@@ -224,15 +224,15 @@ OK: 5m: 0%, 1m: 4%, 5s: 11%
224224
The difference is that with show-all all the values are shown.
225225
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.
226226
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)`.
228228
This is something you could have achieved yourself but show-all makes it simpler as well as makes intent much clearer.
229229

230230
## Advanced options
231231

232232
### Performance data configuration
233233

234234
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.
236236
This command line option is a bit more complicated then changing filters as it is very free form.
237237
It works a bit like CSS style sheets where you have selectors and lists of keys and values.
238238
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 ...
245245
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
246246
```
247247

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.
250250

251251
Formatted performance data:
252252
```
@@ -259,8 +259,8 @@ C:\ used 213.605 GB 178.777 201.124 223.471 0
259259
, E:\ used 0 B 0 0 0 0
260260
```
261261

262-
Now we can see we have several types of performance data for each drive. We have "used" and we have "used %".
263-
Both of these can be configured individually and the way to access them is by their "suffix" which is "used" and "used %".
262+
Now we can see we have several types of performance data for each drive. We have `used` and we have `used %`.
263+
Both of these can be configured individually and the way to access them is by their "suffix" which is `used` and `used %`.
264264

265265
selecting based on suffix: `"perf-config=used(...) used %(...)"`
266266

@@ -314,15 +314,15 @@ Now this is not what we expected: right?
314314
Why did the 5:ages get back? End even worse why were they renamed "c:".
315315
The reason for this is simple. Selection is done on multiple levels. We match (in the following order)
316316

317-
1. <prefix>.<object>.<suffix>
318-
2. <prefix>.<object>
319-
3. <object>.<suffix>
320-
4. <prefix>
321-
5. <suffix>
322-
6. <object>
317+
1. `prefix.object.suffix`
318+
2. `prefix.object`
319+
3. `object.suffix`
320+
4. `prefix`
321+
5. `suffix`
322+
6. `object`
323323

324324
So what are the various suffixes and prefixes?
325-
Well in the case of check_drivesize they are:
325+
Well in the case of `check_drivesize` they are:
326326

327327
| Value | Prefix | Object | Suffix |
328328
|----------|--------|--------|--------|
@@ -333,7 +333,7 @@ Well in the case of check_drivesize they are:
333333

334334
So using "used" as a stand along selector is a bit bad since we match BOTH used and used %.
335335
And usually this is fine, setting the unit for %:s does not change anything and thus "it works".
336-
If we want to differentiate between them we need to use a dot notation syntax which looks like this: <prefix>.<object>.<suffix>.
336+
If we want to differentiate between them we need to use a dot notation syntax which looks like this: `<prefix>.<object>.<suffix>`.
337337
As we saw above they are tried in various combination so leaving out something should get us a broader selection.
338338

339339
Correct selection:

docs/faq.md

+27-27
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ NSCP has a built-in "test and debug" mode that you can activate with the followi
66

77
What this does is two things.
88

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.
1212

1313

1414
## 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
2323
- Second thing to check is whether the servers' performance counters working?
2424
Sometimes the performance counters end up broken and need to be rebuilt there is a command to validate performance counters: `nscp sys --validate`
2525

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.
2727

2828
## 1.4 Bind failed
2929

3030
Usually this is due to running more then once instance of NSClient++ or possibly running another program that uses the same port.
3131

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)
3434

3535
## 1.5 EventlogBuffer is too small
3636

3737
!!! 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
3939

4040
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.
4141

@@ -47,7 +47,7 @@ buffer_size=128000
4747
## 1.6 System Tray does not work
4848

4949
!!! note
50-
System tray is currently disabled and will be added back at some point
50+
System tray was removed in 0.4.0.
5151

5252
## 1.7 I get <insert random error from Nagios here>
5353

@@ -65,11 +65,11 @@ net start nscp
6565

6666
Please check and include this information before you submit questions and/or bug reports.
6767

68-
## 1.8 High CPU load and check_eventlog
68+
## 1.8 High CPU load and `check_eventlog`
6969

7070
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
7171

72-
`CheckEventLog ... scan-range=12h ...`
72+
`check_eventlog ... scan-range=12h ...`
7373

7474
## 1.9 Return code of 139 is out of bounds
7575

@@ -145,12 +145,12 @@ allow nasty characters=true
145145

146146
To not use nasty characters you can replace man y of them in built-in commands:
147147

148-
|Expression|Replacement|
149-
|----------|-----------|
150-
| > | gt |
151-
| < | lt |
152-
| ' | str(...) |
153-
| ${..} | %(..) |
148+
| Expression | Replacement |
149+
|------------|-------------|
150+
| > | gt |
151+
| < | lt |
152+
| ' | str(...) |
153+
| ${..} | %(..) |
154154

155155

156156
# 3. Versions
@@ -166,7 +166,7 @@ In generally do NOT fix issues in several years old versions.
166166

167167
# 4. Network
168168

169-
## 4.1 Rejected connection from: <ip address here>
169+
## 4.1 Rejected connection from: your IP address here
170170

171171
This is due to invalid configuration.
172172
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
193193

194194
If your command takes 60 seconds you need to set the timeouts like this:
195195

196-
**1. Script timeout: 60s**
196+
### 1. Script timeout: 60s
197197

198198
```
199199
[/settings/external scripts/wrappings]
200200
vbs = cscript.exe //T:120 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%
201201
```
202202

203-
**2. External script timeout: 65 seconds**
203+
### 2. External script timeout: 65 seconds
204204

205205
```
206206
[/settings/external scripts]
207207
timeout = 65
208208
```
209209

210-
**3. NRPE/server timeout: 70s**
210+
### 3. NRPE/server timeout: 70s
211211

212212
```
213213
[settings/NPRE/server]
214214
timeout = 70
215215
```
216216

217-
**4. check_nrpe timeout: 75s**
217+
### 4. check_nrpe timeout: 75s
218218

219219
```
220220
check_nrpe -t 75
221221
```
222222

223-
**5. Nagios service check timeout: 80s**
223+
### 5. Nagios service check timeout: 80s
224224

225225
```
226226
service_check_timeout=80
@@ -239,10 +239,10 @@ level = info
239239
max size = 2048000
240240
```
241241

242-
## 5.2 What's the difference between CheckFoo and check_foo
242+
## 5.2 What's the difference between `CheckFoo` and `check_foo`
243243

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..
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..
246246
The previous ones are only for compatibility and will eventually be removed from NSClient++.
247247
Currently they are about 90% compatible which means some things will not work as before and some commands are not even present anymore.
248248

@@ -252,7 +252,7 @@ Currently they are about 90% compatible which means some things will not work as
252252
## 5.3 I use check_nt and...
253253

254254
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.
256256

257257
## 5.4 MEMUSE reports the wrong value
258258

@@ -296,7 +296,7 @@ ssl = true
296296
insecure = true
297297
```
298298

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.
300300

301301

302302
# 8. My question is not here?

0 commit comments

Comments
 (0)