upd
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s

This commit is contained in:
2026-05-26 14:02:32 +03:00
parent bf51924adb
commit eb6235bd3e
41 changed files with 1509 additions and 61 deletions
+39
View File
@@ -0,0 +1,39 @@
using System.Text;
namespace GenerateYAMLforZabbix
{
internal class Program
{
static void Main(string[] args)
{
var list = new List<string[]>();
var lines = File.ReadAllLines("listCam.txt", Encoding.UTF8);
foreach (var line in lines)
{
var uzel = line.Split(';');
list.Add(uzel);
}
foreach (var host in list)
{
//var act4 = host[0].Split(".")[3];
var text = $""+
$" - host: {host[0]}\r\n" +
$" name: (СПб){host[1]}\r\n" +
$" templates:\r\n" +
$" - name: 'SEC Dahua Camera SNMP'\r\n" +
$" groups:\r\n" +
$" - name: dahua.cam.spb\r\n" +
$" interfaces:\r\n" +
$" - type: SNMP\r\n" +
$" ip: {host[0]}\r\n" +
$" port: '161'\r\n" +
$" details:\r\n" +
$" community: '{{$SNMP_COMMUNITY}}'\r\n" +
$" interface_ref: if1\r\n" +
$" inventory_mode: DISABLED\r\n";
File.AppendAllText("hosts.yaml", text, Encoding.UTF8);
}
}
}
}