Skip to content

Commit 74d46d3

Browse files
committed
Merge remote-tracking branch 'origin/add-monitoring' into add-monitoring
2 parents f1ff3ba + 5727674 commit 74d46d3

File tree

2 files changed

+36
-31
lines changed

2 files changed

+36
-31
lines changed

osfv_cli/monitoring/zabbix/External_Check.md

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,74 +4,78 @@ This is a brief guide on setting up external checks in Zabbix.
44
You can find example scripts in this folder.
55

66
## Preparation
7-
1. Make sure your script is in
7+
8+
1. Make sure your script is in
9+
810
```
9-
/usr/lib/zabbix/externalscripts
11+
/usr/lib/zabbix/externalscripts
1012
```
13+
1114
> The default location of externalscripts can be changed in `/etc/zabbix/zabbix_server.conf` by editing `ExternalScripts=/usr/lib/zabbix/externalscripts` (make sure to remove #)
1215
1316
**Ensure that you have only one tab open when creating anything in Zabbix (items/triggers/hosts).**
1417
> It's likely that the last used tab is overwriting session data.
1518
16-
17-
1819
## Create the item in Zabbix
20+
>
1921
> Item is a tool that gathers data from device, system or external script
2022
2. Navigate to **Configuration** > **Hosts**.
2123
2. Go to the **Items** next to the host you want to monitor.
2224
2. Click **Create item** in top right.
23-
- Change Type to **External check**.
24-
- As key use your script name together with desired **Macro**, for example `script.sh[{HOST.IP}]`.
25-
+ You can combine multiple Macros `script.sh[{HOST.DESCRIPTION},{HOST.ID},{HOST.CONN}]`.
26-
25+
- Change Type to **External check**.
26+
- As key use your script name together with desired **Macro**, for example `script.sh[{HOST.IP}]`.
27+
+ You can combine multiple Macros `script.sh[{HOST.DESCRIPTION},{HOST.ID},{HOST.CONN}]`.
2728

2829
[list of macros](https://www.zabbix.com/documentation/current/en/manual/appendix/macros/supported_by_location#host-inventory)
2930

3031
## Create the trigger
32+
>
3133
> Trigger is a rule that watches for specific events, like high CPU usage.
3234
3. Navigate to **Configuration** > **Hosts**.
3335
3. Go to the **Triggers** next to the host with the item you want to monitor.
3436
3. Click **Create trigger** in top right.
35-
- Severity: Select as needed.
36-
- Expression: press Add
37-
+ Item: Select the item for which you want to create a trigger.
38-
+ Function: Defines how your trigger will be activated.
39-
+ Result: Actual rule of activation.
37+
- Severity: Select as needed.
38+
- Expression: press Add
39+
+ Item: Select the item for which you want to create a trigger.
40+
+ Function: Defines how your trigger will be activated.
41+
+ Result: Actual rule of activation.
4042
> If your script returns numeric values directly and/or you don't won't to calculate the average result, simply use `last()` function
4143
4244
## Testing
45+
4346
4. Test manually.
4447
- login as **zabbix** user and go to the script location.
4548
- run your script as zabbix.
4649
> You can directly incorporate information from Zabbix macros into your command, such as ./script.sh '192.168.10.0'.
4750
4851
4. Test in zabbix web interface.
49-
- Go to your item location.
52+
- Go to your item location.
5053
- If you are using external checks, **Test** option should be available.
51-
+ Check if you Macros give proper data to your script.
52-
+ Press **Get value and test**.
54+
- Check if you Macros give proper data to your script.
55+
- Press **Get value and test**.
5356

5457
4. Common problems.
5558
- Timeout: you can change (not VM)Timeout(and TrapperTimeout if needed) settings in /etc/zabbix/zabbix_server.conf
5659
- Make sure all necesery files and commands are accessible for zabbix user.
5760
- If you find something else, please update the file.
5861

5962
## Templates
60-
5. Navigate to **Configuration** > **Templates**.
63+
64+
5. Navigate to **Configuration** > **Templates**.
6165
5. Click **Create template** in top right.
62-
- Specify the name, group and other information if needed.
66+
- Specify the name, group and other information if needed.
6367
5. Add **items**, **trigger** and **macros** if needed.
6468
5. Link the template to **Hosts**
65-
5. Mass update
66-
- Go to **Hosts**.
67-
- Check the boxes next to the desired hosts.
68-
- Scroll to the bottom and click **Mass update**.
69-
+ Select **Link templates**.
70-
+ Choose **Link**.
71-
+ Enter your template name.
72-
+ Press **Update**.
73-
74-
5. Single update
75-
- Open desired **Host**.
76-
- Add your Template under Templates.
77-
- Press **Update**.
69+
5. Mass update
70+
- Go to **Hosts**.
71+
- Check the boxes next to the desired hosts.
72+
- Scroll to the bottom and click **Mass update**.
73+
+ Select **Link templates**.
74+
+ Choose **Link**.
75+
+ Enter your template name.
76+
+ Press **Update**.
77+
78+
5. Single update
79+
+ Open desired **Host**.
80+
+ Add your Template under Templates.
81+
+ Press **Update**.

osfv_cli/osfv_cli/osfv_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def list_my_assets(snipeit_api, args):
7272
for asset in my_assets:
7373
print_asset_details(asset)
7474

75+
7576
# List unused assets
7677
def list_unused_assets(snipeit_api, args):
7778
all_assets = snipeit_api.get_all_assets()

0 commit comments

Comments
 (0)