fromjpeg')) { copy($sourcefile, $destfile); $return = array('filesize' => filesize($destfile), 'width' => $src_width, 'height' => $src_height); return $return; } $src_scale = $src_width / $src_height; $des_scale = $forcedwidth / $forcedheight; if ($src_width <= $forcedwidth && $src_height <= $forcedheight) { $des_width = $src_width; $des_height = $src_height; } elseif ($src_scale >= $des_scale) { $des_width = ($src_width >= $forcedwidth) ? $forcedwidth : $src_width; $des_height = $des_width / $src_scale; $des_height = ($des_height >= $forcedheight) ? $forcedheight : $des_height; } else { $des_height = ($src_height >= $forcedheight) ? $forcedheight : $src_height; $des_width = $des_height * $src_scale; $des_width = ($des_width >= $forcedwidth) ? $forcedwidth : $des_width; } $des_width = ceil($des_width); $des_height = ceil($des_height); switch ($getimgsize['mime']) { case 'image/jpeg': $img_src = imagecreatefromjpeg($sourcefile); !$img_src && $img_src = imagecreatefromgif($sourcefile); break; case 'image/gif': $img_src = imagecreatefromgif($sourcefile); !$img_src && $img_src = imagecreatefromjpeg($sourcefile); break; case 'image/png': $img_src = imagecreatefrompng($sourcefile); break; case 'image/wbmp': $img_src = imagecreatefromwbmp($sourcefile); break; default : return $return; } if (!$img_src) return $return; $img_dst = imagecreatetruecolor($des_width, $des_height); imagefill($img_dst, 0, 0, 0xFFFFFF); imagecopyresampled($img_dst, $img_src, 0, 0, 0, 0, $des_width, $des_height, $src_width, $src_height); $tmppath = isset($conf['tmp_path']) ? $conf['tmp_path'] : ini_get('upload_tmp_dir') . '/'; '/' == $tmppath AND $tmppath = './tmp/'; $tmpfile = $tmppath . md5($destfile) . '.tmp'; switch ($destext) { case 'jpg': imagejpeg($img_dst, $tmpfile, 75); break; case 'jpeg': imagejpeg($img_dst, $tmpfile, 75); break; case 'gif': imagegif($img_dst, $tmpfile); break; case 'png': imagepng($img_dst, $tmpfile); break; } $r = array('filesize' => filesize($tmpfile), 'width' => $des_width, 'height' => $des_height);; copy($tmpfile, $destfile); is_file($tmpfile) && unlink($tmpfile); imagedestroy($img_dst); return $r; } function well_image_clip($sourcefile, $destfile, $clipx, $clipy, $clipwidth, $clipheight, $getimgsize = '') { global $conf; empty($getimgsize) AND $getimgsize = getimagesize($sourcefile); if (empty($getimgsize)) { return 0; } else { $imgwidth = $getimgsize[0]; $imgheight = $getimgsize[1]; if (0 == $imgwidth || 0 == $imgheight) { return 0; } } if (!function_exists('imagecreatefromjpeg')) { copy($sourcefile, $destfile); return filesize($destfile); } switch ($getimgsize[2]) { case 1 : $imgcolor = imagecreatefromgif($sourcefile); break; case 2 : $imgcolor = imagecreatefromjpeg($sourcefile); break; case 3 : $imgcolor = imagecreatefrompng($sourcefile); break; case 15: $imgcolor = imagecreatefromwbmp($sourcefile); break; case 18: $imgcolor = imagecreatefromwebp($sourcefile); break; } if (!$imgcolor) return 0; $img_dst = imagecreatetruecolor($clipwidth, $clipheight); imagefill($img_dst, 0, 0, 0xFFFFFF); imagecopyresampled($img_dst, $imgcolor, 0, 0, $clipx, $clipy, $imgwidth, $imgheight, $imgwidth, $imgheight); $tmppath = isset($conf['tmp_path']) ? $conf['tmp_path'] : ini_get('upload_tmp_dir') . '/'; '/' == $tmppath AND $tmppath = './tmp/'; $tmpfile = $tmppath . md5($destfile) . '.tmp'; imagejpeg($img_dst, $tmpfile, 75); $n = filesize($tmpfile); copy($tmpfile, $destfile); is_file($tmpfile) && unlink($tmpfile); return $n; } function well_image_ext($filename) { return strtolower(substr(strrchr($filename, '.'), 1)); } ?>GLPI资产管理系统安装Fusioninventory插件发现Windows和Linux主机
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

GLPI资产管理系统安装Fusioninventory插件发现Windows和Linux主机

运维笔记admin1浏览0评论

1:登录GLPI系统,所有信息都可以空。

 2:点击设置--->插件,在最下面可以看到查看插件目录。

3:可以看到很多的插件,我们安装Fusioninventory。可以点击链接进入网页在里面下载。

4: 先进入插件目录。

cd /var/www/html/glpi/plugins/

5:下载插件

wget https://github/fusioninventory/fusioninventory-for-glpi/releases/download/glpi10.0.3%2B1.0/fusioninventory-10.0.3+1.0.tar.bz2

6:解压插件

tar -jxvf fusioninventory-10.0.1+1.0.tar.bz2

7:在登录GLPI系统在设置--->插件中可以看到插件,点击+号开始安装。 

8:安装完成,但是还没有启动。

9:点击红点启动,插件已经激活启动。

10:在下面地址下相应的Windows Agnet代理程序。

Releases · fusioninventory/fusioninventory-agent · GitHub

11: 找一台Windwos x64机器安装代理程序。

12:安装基本一路下一步,没有什么需要修改的,只是有几处需要填写相关信息,远程目标参考下面例子填写。

13:下面的界面填写服务器地址和GLPI系统的用户名和密码。 

14:下面的端口号记住,一会儿会用到。什么都不用填写。  

15:打开浏览器输入http://127.0.0.1:62354,点击Force an Inventory,这样会快的发现主机。只要安装了代理程序不强制刷新,过一段时间客户机也会和主机同步的。

16:强制完成。

17:过一会儿登录GLPI系统就能发现电脑了。现在显示有一台电脑,还有软件的相关信息。这是一台虚拟机,所以没有显示器的信息。点击电脑,或者软件可以看详细的信息。

18:登录一台Linxu主机,安装代理,我以CentOS8为例,安装代理程序。

19:启用PowerTools库。 

sudo dnf config-manager --set-enabled powertools

  20:我们装下面的代理程序。

yum install fusioninventory-agent fusioninventory-agent-task-inventory -y

21: 启动代理程序。

systemctl start fusioninventory-agent

22:把代理程序加入到开机自启中。

systemctl enable fusioninventory-agent

23:编辑代理程序的配置文件。

vi /etc/fusioninventory/agent.cfg

24:添加server的信息,保存退出。

 25:重启代理服务。

 systemctl restart fusioninventory-agent.service 

26:强制刷新。

fusioninventory-agent

27:过一会儿登录GLPI系统就看到新的主机了。我这里为什么显示是三台机器,是因为我再一台实体机上安装了代理,但是没有强制刷新,想试试自动发现的速度,不比强制刷新慢多少。

28:GLPI系统的安装,请参考下面的链接。 

GLPI系统安装

发布评论

评论列表(0)

  1. 暂无评论